View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3   
4    Copyright (c) 2004-2005, OntoText Lab. / SIRMA
5   
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  
19  /**
20   * <p>Title: WSMO4J</p>
21   * <p>Description: WSMO API and a Reference Implementation</p>
22   * <p>Copyright:  Copyright (c) 2004-2005</p>
23   * <p>Company: OntoText Lab. / SIRMA </p>
24   */
25  
26  package org.wsmo.datastore;
27  
28  import java.util.*;
29  
30  import org.wsmo.common.*;
31  
32  
33  public interface DataStore {
34  
35      /**
36       * Loads an Entity given its identifier
37       * @param id The ID of the Entity to Load
38       * @return all Entities corresponding to the povided ID (or null if not found). Note that if metamodelling
39       * is not used, e.g. the language subset is WSML-Core, then there will be only one entity with a given ID.
40       * @see Entity
41       */
42      Set <Entity> load(Identifier id);
43  
44      /**
45       * Loads an Entity given its identifier
46       * @param id The ID of the Entity to Load
47       * @param clazz The type of the desired entity to be loaded
48       * @return the entity with the specified identifier and type or <code>null</code> if no such
49       * entity is found.
50       * @see Entity
51       */
52      Entity load(Identifier id, Class clazz);
53  
54      /**
55       * Store an Entity into datastore
56       * @param item The entity to Store
57       */
58      void save(Entity item);
59  
60      /**
61       * Remove <b>all</b> entities identified by the provided Identifier from the Datastore
62       * @param id The ID of the Entity(ies) to be removed
63       */
64      void remove(Identifier id);
65  
66      /**
67       * Remove an entity identified by its Identifier and class type from the Datastore. The class is the WSMO API
68       * interface that the entity implements (e.g. org.omwg.ontology.Concept, etc) and <b>not</b> a specific class
69       * implementating the WSMO API interface
70       * @param id The ID of the Entity to be removed
71       */
72      void remove(Identifier id, Class clazz);
73  
74  }
75  
76  /*
77   * $Log$
78   * Revision 1.7  2007/04/02 12:13:16  morcen
79   * Generics support added to wsmo-api, wsmo4j and wsmo-test
80   *
81   * Revision 1.6  2005/10/19 08:32:58  alex_simov
82   * load(Identifier, Class) method added
83   *
84   * Revision 1.5  2005/10/18 09:15:55  marin_dimitrov
85   * load() returns a Set (was Entity[])
86   *
87   * Revision 1.3  2005/10/17 12:41:22  marin_dimitrov
88   * metamodeliing extensions
89   *
90   */