View Javadoc

1   package org.apache.jcs.auxiliary.remote.behavior;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
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  }