Rice Pastry API

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 3613 2007-02-15 14:45:14Z jstewart $
Author:
Alan Mislove, Andreas Haeberlen

Field Summary
static long INFINITY_EXPIRATION
          Timeout 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
 

Field Detail

INFINITY_EXPIRATION

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
Method Detail

insert

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:
insert in interface Past
Parameters:
obj - the object to be inserted
command - Command to be performed when the result is received

insert

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

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:
id - The keys which to refresh
expiration - The time to extend the lifetime to
command - Command to be performed when the result is received

refresh

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:
id - The keys which to refresh
expiration - The time to extend the lifetime to (applies to all keys)
command - Command to be performed when the result is received

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection