1 package org.xvsm.interfaces.lookup;
2
3 import java.util.Hashtable;
4
5 import org.xvsm.core.ContainerRef;
6 import org.xvsm.lookup.exceptions.ContainerAlreadyPublishedException;
7 import org.xvsm.lookup.exceptions.ContainerNotPublishedException;
8 import org.xvsm.lookup.exceptions.LookupException;
9
10 /***
11 * This is the Interface for the Lookup-Service, which has to be implemented by
12 * the classes, that implement the various technologies like LDAP.
13 * The functions provided by this class are used by the Lookup-Manager. Check the
14 * Lookup-Manager class to see which constructors are required.
15 *
16 * @author Hannu-Daniel Goiss
17 */
18 public interface ILookup {
19 /***
20 * publishes a container reference
21 *
22 * @param cref
23 * the container-reference to be published
24 * @throws LookupException
25 * @throws ContainerAlreadyPublishedException
26 */
27 void publish(ContainerRef cref) throws ContainerAlreadyPublishedException, LookupException;
28 void publish(String cref) throws ContainerAlreadyPublishedException, LookupException;
29 /***
30 * unpublishes a container reference
31 *
32 * @param cref
33 * the container-reference to be unpublished
34 * @throws ContainerNotPublishedException
35 * @throws LookupException
36 */
37 void unpublish(ContainerRef cref) throws ContainerNotPublishedException, LookupException;
38 /***
39 * updates the meta-information of the container, which has been stored by
40 * the lookup-service.
41 *
42 * @param cref
43 * the container-reference to be updated
44 * @throws ContainerNotPublishedException
45 * @throws LookupException
46 */
47 void updateDescription(ContainerRef cref) throws ContainerNotPublishedException, LookupException;
48 /***
49 * lookup by container name
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
60 *
61 * @param list
62 * @return
63 * @throws ContainerNotFoundException
64 * @throws LookupException
65 */
66 ContainerRef[] lookup(Hashtable list) throws ContainerNotPublishedException, LookupException;
67 /***
68 * lookup by container name and list of attributes
69 *
70 * @param name
71 * the name to be searched for
72 * @param list
73 * the attributes to be searched for. This is supposed to be a hashtable with String key-value pairs
74 * @return
75 * @throws ContainerNotFoundException
76 * @throws LookupException
77 */
78 ContainerRef[] lookup(String name, Hashtable list) throws ContainerNotPublishedException, LookupException;
79
80 ContainerRef[] publishedContainers() throws LookupException;
81 }