rice.p2p.aggregation
Interface Aggregation
- All Known Implementing Classes:
- AggregationImpl
- public interface Aggregation
DESCRIBE THE INTERFACE
- Version:
- $Id: pretty.settings 2305 2005-03-11 20:22:33Z jeffh $
- Author:
- jeffh
Method Summary |
void |
flush(Continuation command)
Creates aggregates from all objects in the local object cache. |
void |
flush(Id id,
Continuation command)
Creates an aggregate that includes the most current object with the
specified key. |
java.io.Serializable |
getHandle()
Fetches the handle object. |
void |
reset(Continuation command)
Deletes all local state, including the aggregate list and all objects
waiting in the local buffer. |
void |
rollback(Id id,
Continuation command)
Attempts to retrieve the most recent object that has been inserted by the
local node under the specified key. |
void |
setHandle(java.io.Serializable handle,
Continuation command)
Restores the handle object. |
getHandle
public java.io.Serializable getHandle()
- Fetches the handle object. This object is important in the event of a
failure that causes Aggregation to lose its local metadata cache. When the
handle object is later restored via setHandle(), Aggregation can recover
all objects that have been aggregated prior to the getHandle() call, except
objects that have already expired. Note that this does not include objects
that were still in the local buffer when the failure occurred. To prevent
data loss, it is recommended to invoke flush() before fetching the handle
object.
- Returns:
- the current handle object
setHandle
public void setHandle(java.io.Serializable handle,
Continuation command)
- Restores the handle object. This method should always be invoked at
startup, using the most current handle object available. When the
continuation is invoked, all non-expired objects linked to the handle are
accessible from the local node.
- Parameters:
handle
- the handle objectcommand
- Command to be performed when the method completes.
flush
public void flush(Id id,
Continuation command)
- Creates an aggregate that includes the most current object with the
specified key. When the continuation is invoked, the object is persistent
and linked to the current handle object.
- Parameters:
id
- the key of the object to be made persistent.command
- Command to be performed when the method completes.
flush
public void flush(Continuation command)
- Creates aggregates from all objects in the local object cache. When the
continuation is invoked, all objects that were inserted prior to flush()
are persistent and linked to the current handle object.
- Parameters:
command
- Command to be performed when the method completes.
rollback
public void rollback(Id id,
Continuation command)
- Attempts to retrieve the most recent object that has been inserted by the
local node under the specified key. This is useful when the object has been
overwritten by an attacker. This method may fail or return an outdated
version of the object if a) the object is not linked to the current handle,
or b) the object was never aggregated because of the aggregation policy.
- Parameters:
id
- the key of the object to be retrievedcommand
- Command to be performed when the method completes.
reset
public void reset(Continuation command)
- Deletes all local state, including the aggregate list and all objects
waiting in the local buffer. This is useful when the local instance appears
to have been corrupted or tampered with. The state can be recovered by
invoking setHandle() with an earlier handle object, and by using rollback()
on objects that appear to have been overwritten.
- Parameters:
command
- Command to be performed when the method completes.
Copyright © 2001-2005 - Rice Pastry.