1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.cluster;
18
19 /***
20 * Node Manager Interface
21 *
22 * @author <a href="mailto:hajo@bluesunrise.com">Hajo Birthelmer</a>
23 * @version
24 */
25 public interface NodeManager
26 {
27
28 public static final int INVALID_NODE_REQUEST = -1;
29 public static final int NODE_SAVED = 0;
30 public static final int NODE_OUTDATED = 1;
31 public static final int NODE_NEW = 2;
32
33 /***
34 * Returns the current "knowledge" about a given node (i.e. the portlet application).
35 * If the contextName doesn't exist NODE_NEW is returned.
36 * An id requested newer than what is stored is indicated by NODE_OUTDATED.
37 * @param id
38 * @param contextName
39 * @return
40 */
41 public int checkNode(Long id, String contextName);
42
43 /***
44 * Add a new node or update the id of an existing one...(i.e. the portlet application) to the local info
45 * @param id
46 * @param contextName
47 * @throws Exception
48 */
49 public void addNode(Long id, String contextName) throws Exception;
50
51 /***
52 * return the number of currently stored nodes
53 * @return
54 */
55 public int getNumberOfNodes();
56
57 /***
58 * Remove a node
59 * @param id
60 * @param contextName
61 * @throws Exception
62 */
63 public void removeNode(String contextName) throws Exception;
64
65 }