Rice Pastry API

rice.p2p.past
Interface PastPolicy

All Known Implementing Classes:
PastPolicy.DefaultPastPolicy

public interface PastPolicy

Version:
$Id: PastPolicy.java 4654 2009-01-08 16:33:07Z jeffh $
Author:
Alan Mislove

Nested Class Summary
static class PastPolicy.DefaultPastPolicy
          The default policy for Past, which fetches any available copy of a replicated object and always allows inserts locally.
 
Method Summary
 boolean allowInsert(PastContent content)
          This method is call before an insert() is processed on the local node.
 void fetch(Id id, NodeHandle hint, Cache backup, Past past, Continuation command)
          This method is called when Past is told to fetch a key.
 

Method Detail

fetch

void fetch(Id id,
           NodeHandle hint,
           Cache backup,
           Past past,
           Continuation command)
This method is called when Past is told to fetch a key. This method allows the application to specify how a replica is fetched and authenticated. The client should fetch the object (possibly using the past instance provided) and then return the object to the provided continuation. The client *MUST* call the continuation at some point in the future, even if the request is lost.

Parameters:
id - The id to fetch
past - The local past instance
backup - The backup cache, where the object *might* be located
command - The command to call with the replica to store

allowInsert

boolean allowInsert(PastContent content)
This method is call before an insert() is processed on the local node. This allows applications to make a decision on whether or not to store the replica. Unless you know what you are doing, don't return anything but 'true' here.

Parameters:
content - The content about to be stored
Returns:
Whether the insert should be allowed

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection