1 package org.apache.jcs.auxiliary.remote.behavior;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.IOException;
23 import java.io.Serializable;
24 import java.rmi.Remote;
25 import java.util.Set;
26
27 import org.apache.jcs.access.exception.ObjectExistsException;
28 import org.apache.jcs.engine.behavior.ICacheElement;
29 import org.apache.jcs.engine.behavior.ICacheService;
30
31 /***
32 * Used to retrieve and update the remote cache.
33 */
34 public interface IRemoteCacheService
35 extends Remote, ICacheService
36 {
37
38 /***
39 * Puts a cache item to the cache.
40 * <p>
41 * @param item
42 * @param requesterId
43 * @throws ObjectExistsException
44 * @throws IOException
45 */
46 public void update( ICacheElement item, long requesterId )
47 throws ObjectExistsException, IOException;
48
49 /***
50 * Removes the given key from the specified cache.
51 * <p>
52 * @param cacheName
53 * @param key
54 * @param requesterId
55 * @throws IOException
56 */
57 public void remove( String cacheName, Serializable key, long requesterId )
58 throws IOException;
59
60 /***
61 * Remove all keys from the sepcified cache.
62 * <p>
63 * @param cacheName
64 * @param requesterId
65 * @throws IOException
66 */
67 public void removeAll( String cacheName, long requesterId )
68 throws IOException;
69
70 /***
71 * Returns a cache bean from the specified cache; or null if the key does
72 * not exist.
73 * <p>
74 * Adding the requestor id, allows the cache to determine the sournce of the
75 * get.
76 * <p>
77 * @param cacheName
78 * @param key
79 * @param requesterId
80 * @return ICacheElement
81 * @throws IOException
82 */
83 public ICacheElement get( String cacheName, Serializable key, long requesterId )
84 throws IOException;
85
86 /***
87 * @param cacheName
88 * @param groupName
89 * @return A Set of keys
90 * @throws java.rmi.RemoteException
91 */
92 public Set getGroupKeys( String cacheName, String groupName )
93 throws java.rmi.RemoteException;
94 }