View Javadoc

1   package org.xvsm.interfaces.lookup;
2   
3   import java.util.Hashtable;
4   
5   import org.xvsm.core.ContainerRef;
6   import org.xvsm.internal.exceptions.XCoreException;
7   import org.xvsm.lookup.exceptions.ContainerAlreadyPublishedException;
8   import org.xvsm.lookup.exceptions.ContainerNotPublishedException;
9   import org.xvsm.lookup.exceptions.LookupException;
10  
11  /***
12   * The lookup manager is supposed to manage the various implementations 
13   * of the lookup services.
14   * 
15   * @author Hannu-Daniel Goiss
16   */
17  public interface ILookupManager {
18  	/***
19  	 * publishes the container reference using all known lookup-service implementations.
20  	 * 
21  	 * @param cref
22  	 *              the container-reference to be published
23  	 * @throws ContainerAlreadyPublishedException
24  	 * @throws LookupException
25  	 */
26  	void publish(ContainerRef cref) throws ContainerAlreadyPublishedException, LookupException;
27  	void publish(String cref) throws ContainerAlreadyPublishedException, LookupException;
28  	/***
29  	 * unpublishes the container reference using all known lookup-service implementations.
30  	 * 
31  	 * @param cref
32  	 *              the container-reference to be unpublished
33  	 * @throws ContainerNotPublishedException
34  	 * @throws LookupException
35  	 */
36  	void unpublish(ContainerRef cref) throws ContainerNotPublishedException, LookupException;
37  	/***
38  	 * updates the meta-information of the container, which has been stored by
39  	 * the lookup-service, on all known lookup-service implementations
40  	 * 
41  	 * @param cref
42  	 *              the container-reference to be updated
43  	 * @throws LookupException
44  	 */
45  	void updateDescription(ContainerRef cref) throws ContainerNotPublishedException, LookupException;
46  	/***
47  	 * lookup by container name, on the various lookup-service implementations. the function
48  	 * setAbbrechen specifies, if the lookup will be broken up as soon as a container reference
49  	 * has been found, or not.
50  	 * 
51  	 * @param name
52  	 *             the name to be searched for
53  	 * @return
54  	 * @throws ContainerNotFoundException
55  	 * @throws LookupException
56  	 */
57  	ContainerRef[] lookup(String name) throws ContainerNotPublishedException, LookupException;
58  	/***
59  	 * lookup by list of attributes, on the various lookup-service implementations. the function
60  	 * setAbbrechen specifies, if the lookup will be broken up as soon as a container reference
61  	 * has been found, or not.
62  	 * 
63  	 * @param list
64  	 *             the attributes to be searched for. This is supposed to be a hashtable with String key-value pairs
65  	 * @return
66  	 * @throws ContainerNotFoundException
67  	 * @throws LookupException
68  	 */
69  	ContainerRef[] lookup(Hashtable list) throws ContainerNotPublishedException, LookupException;
70  	/***
71  	 * lookup by container name and list of attributes, on the various lookup-service 
72  	 * implementations. the function setAbbrechen specifies, if the lookup will be broken 
73  	 * up as soon as a container reference has been found, or not.
74  	 * 
75  	 * @param name
76  	 *             the name to be searched for
77  	 * @param list
78  	 *             the attributes to be searched for. This is supposed to be a hashtable with String key-value pairs
79  	 * @return
80  	 * @throws ContainerNotFoundException
81  	 * @throws LookupException
82  	 */
83  	ContainerRef[] lookup(String name, Hashtable list) throws ContainerNotPublishedException, LookupException;
84  	
85  	boolean getGepublished(ContainerRef cref) throws XCoreException;
86  	
87  	ContainerRef[] publishedContainers() throws LookupException;
88  }