rice.p2p.past.gc
Interface GCPast
- All Superinterfaces: 
- Past
- All Known Implementing Classes: 
- AggregationImpl, GCPastImpl, GlacierImpl, Moraine
- public interface GCPast- extends Past
- Version:
- $Id: GCPast.java 2372 2005-03-21 18:56:11Z amislove $
- Author:
- Alan Mislove, Andreas Haeberlen
| Field Summary | 
| static long | INFINITY_EXPIRATIONTimeout value which indicates that the object should never expire.
 | 
 
| Method Summary | 
|  void | insert(PastContent obj,
       Continuation command)Inserts an object with the given ID into this instance of Past.
 | 
|  void | insert(PastContent obj,
       long expiration,
       Continuation command)Inserts an object with the given ID into this instance of Past.
 | 
|  void | refresh(Id[] ids,
        long[] expiration,
        Continuation command)Updates the objects stored under the provided keys id to expire no earlier
 than the provided expiration time.
 | 
|  void | refresh(Id[] ids,
        long expiration,
        Continuation command)Updates the objects stored under the provided keys id to expire no earlier
 than the provided expiration time.
 | 
 
| Methods inherited from interface rice.p2p.past.Past | 
| fetch, getEnvironment, getInstance, getLocalNodeHandle, getReplicationFactor, lookup, lookup, lookupHandle, lookupHandles, setContentDeserializer, setContentHandleDeserializer | 
 
INFINITY_EXPIRATION
public static final long INFINITY_EXPIRATION
- Timeout value which indicates that the object should never expire. Note
 that objects with this timeout value _will_ be deleted in the year
 292473178. If this is a problem, applications should check for this value
 explicitly.
 
- See Also:
- Constant Field Values
 
insert
public void insert(PastContent obj,
                   Continuation command)
- Inserts an object with the given ID into this instance of Past.
 Asynchronously returns a PastException to command, if the operation was
 unsuccessful. If the operation was successful, a Boolean[] is returned
 representing the responses from each of the replicas which inserted the
 object. This method is equivalent to insert(obj, INFINITY_EXPIRATION,
 command) as it inserts the object with a timeout value of infinity. This is
 done for simplicity, as well as backwards-compatibility for applications.
 
- 
- Specified by:
- insertin interface- Past
 
- 
- Parameters:
- obj- the object to be inserted
- command- Command to be performed when the result is received
 
insert
public void insert(PastContent obj,
                   long expiration,
                   Continuation command)
- Inserts an object with the given ID into this instance of Past.
 Asynchronously returns a PastException to command, if the operation was
 unsuccessful. If the operation was successful, a Boolean[] is returned
 representing the responses from each of the replicas which inserted the
 object. The contract for this method is that the provided object will be
 stored until the provided expiration time. Thus, if the application
 determines that it is still interested in this object, it must refresh the
 object via the refresh() method.
 
- 
 
- 
- Parameters:
- obj- the object to be inserted
- expiration- the time until which the object must be stored
- command- Command to be performed when the result is received
 
refresh
public void refresh(Id[] ids,
                    long[] expiration,
                    Continuation command)
- Updates the objects stored under the provided keys id to expire no earlier
 than the provided expiration time. Asyncroniously returns the result to the
 caller via the provided continuation. The result of this operation is an
 Object[], which is the same length as the input array of Ids. Each element
 in the array is either Boolean(true), representing that the refresh
 succeeded for the cooresponding Id, or an Exception describing why the
 refresh failed. Specifically, the possible exceptions which can be returned
 are: ObjectNotFoundException - if no object was found under the given key
 RefreshFailedException - if the refresh operation failed for any other
 reason (the getMessage() will describe the failure)
 
- 
 
- 
- Parameters:
- expiration- The time to extend the lifetime to
- command- Command to be performed when the result is received
- ids- DESCRIBE THE PARAMETER
 
refresh
public void refresh(Id[] ids,
                    long expiration,
                    Continuation command)
- Updates the objects stored under the provided keys id to expire no earlier
 than the provided expiration time. Asyncroniously returns the result to the
 caller via the provided continuation. The result of this operation is an
 Object[], which is the same length as the input array of Ids. Each element
 in the array is either Boolean(true), representing that the refresh
 succeeded for the cooresponding Id, or an Exception describing why the
 refresh failed. Specifically, the possible exceptions which can be returned
 are: ObjectNotFoundException - if no object was found under the given key
 RefreshFailedException - if the refresh operation failed for any other
 reason (the getMessage() will describe the failure)
 
- 
 
- 
- Parameters:
- expiration- The time to extend the lifetime to (applies to all keys)
- command- Command to be performed when the result is received
- ids- DESCRIBE THE PARAMETER
 
Copyright © 2001-2005 - Rice Pastry.