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.locator;
27
28 import java.util.*;
29
30 import org.wsmo.common.*;
31 import org.wsmo.common.exception.*;
32
33
34 /**
35 * An interface representing an entity locator.
36 *
37 * @author not attributable
38 * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
39 */
40 public interface Locator {
41
42 public static final String URI_MAPPING = "Mapping logical URI to physical location identifier";
43
44 /**
45 * Attempts to find an entity based on its IRI. If metamodelling is used (e.g. an extension of WSML-Core)
46 * then more than one entity may correspond to the provied IRI.
47 * @param id The ID of the entity to find
48 * @return The entity(ies) corresponding to the supplied ID or <i>null</i> if none found
49 * @throws org.wsmo.common.exception.SynchronisationException
50 * @see Entity
51 */
52 Set <Entity> lookup(Identifier id)
53 throws SynchronisationException;
54
55 /**
56 * Attempts to find an entity based on its IRI and the type of entity of interest.
57 * Note that the class name is the WSMO API interface name and <b>not</b> the name of a
58 * particular class implementing the WSMO API interface.
59 * @param id The ID of the entity to find
60 * @param clazz the type of entity (e.g. the name of the WSMO API interface name)
61 * @return The entity corresponding to the supplied ID or <i>null</i> if none found
62 * @throws org.wsmo.common.exception.SynchronisationException
63 */
64 Entity lookup(Identifier id, Class clazz)
65 throws SynchronisationException;
66
67 }
68 /*
69 * $Log$
70 * Revision 1.7 2007/04/02 12:13:15 morcen
71 * Generics support added to wsmo-api, wsmo4j and wsmo-test
72 *
73 * Revision 1.6 2006/08/22 16:25:48 nathaliest
74 * added locator implementation and set it as default locator at the locator manager
75 *
76 * Revision 1.5 2005/10/18 09:16:47 marin_dimitrov
77 * lookup() returns a Set (was Entity[])
78 *
79 * Revision 1.4 2005/10/18 09:13:01 marin_dimitrov
80 * lookup() returns a Set (was Entity[])
81 *
82 * Revision 1.3 2005/10/17 13:14:44 marin_dimitrov
83 * metamodeliing extensions
84 *
85 * Revision 1.2 2005/07/06 07:09:20 vassil_momtchev
86 * Locators now are managed by LocatorManager (attribute of the Factory)
87 *
88 * Revision 1.1 2005/06/27 08:51:50 alex_simov
89 * refactoring: *.io.locator -> *.locator
90 * refactoring: *.io.parser -> *.parser
91 * refactoring: *.io.datastore -> *.datastore
92 *
93 * Revision 1.4 2005/06/01 10:55:46 marin_dimitrov
94 * v0.4.0
95 *
96 * Revision 1.4 2005/05/31 13:13:59 damian
97 * looku changed to accept Identifier instead of IRI
98 *
99 * Revision 1.3 2005/05/31 09:38:05 marin
100 * Locator interface
101 *
102 */