Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.past
Interface PastPolicy

All Known Implementing Classes:
  PastPolicy.DefaultPastPolicy

public interface PastPolicy

Version:
  $Id: PastPolicy.java 2302 2005-03-11 00:58:26Z 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

    public 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
    `hint` - DESCRIBE THE PARAMETER

### allowInsert

    public 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.