Rice Pastry API

rice.persistence
Interface Catalog

All Known Subinterfaces:
Cache, Storage
All Known Implementing Classes:
LRUCache, MemoryStorage, PersistentStorage, StorageManager

public interface Catalog

This interface is the abstraction of something which holds objects which are available for lookup. This interface does not, however, specify how the objects are inserted, and makes NO guarantees as to whether objects available at a given point in time will be available at a later time. Implementations of the Catalog interface are designed to be interfaces which specify how objects are inserted and stored, and are designed to include a cache and persistent storage interface.


Method Summary
 boolean exists(rice.p2p.commonapi.Id id)
          Returns whether or not an object is present in the location id.
 void exists(rice.p2p.commonapi.Id id, rice.Continuation c)
          Returns whether or not an object is present in the location id.
 void getObject(rice.p2p.commonapi.Id id, rice.Continuation c)
          Returns the object identified by the given id, or null if there is no cooresponding object (through receiveResult on c).
 void getTotalSize(rice.Continuation c)
          Returns the total size of the stored data in bytes.The result is returned via the receiveResult method on the provided Continuation with an Integer representing the size.
 rice.p2p.commonapi.IdSet scan(rice.p2p.commonapi.IdRange range)
          Return the objects identified by the given range of ids.
 void scan(rice.p2p.commonapi.IdRange range, rice.Continuation c)
          Return the objects identified by the given range of ids.
 

Method Detail

exists

public boolean exists(rice.p2p.commonapi.Id id)
Returns whether or not an object is present in the location id.

Parameters:
id - The id of the object in question.
Returns:
Whether or not an object is present at id.

exists

public void exists(rice.p2p.commonapi.Id id,
                   rice.Continuation c)
Returns whether or not an object is present in the location id. The result is returned via the receiveResult method on the provided Continuation with an Boolean represnting the result. Returns True or False depending on whether the object exists (through receiveResult on c);

Parameters:
c - The command to run once the operation is complete
id - The id of the object in question.

getObject

public void getObject(rice.p2p.commonapi.Id id,
                      rice.Continuation c)
Returns the object identified by the given id, or null if there is no cooresponding object (through receiveResult on c).

Parameters:
id - The id of the object in question.
c - The command to run once the operation is complete

scan

public void scan(rice.p2p.commonapi.IdRange range,
                 rice.Continuation c)
Return the objects identified by the given range of ids. The IdSet returned contains the Ids of the stored objects. The range is partially inclusive, the lower range is inclusive, and the upper exclusive. When the operation is complete, the receiveResult() method is called on the provided continuation with a IdSet result containing the resulting IDs.

Parameters:
c - The command to run once the operation is complete

scan

public rice.p2p.commonapi.IdSet scan(rice.p2p.commonapi.IdRange range)
Return the objects identified by the given range of ids. The IdSet returned contains the Ids of the stored objects. The range is partially inclusive, the lower range is inclusive, and the upper exclusive. NOTE: This method blocks so if the behavior of this method changes and no longer stored in memory, this method may be deprecated.

Parameters:
range - The range to query
Returns:
The idset containg the keys

getTotalSize

public void getTotalSize(rice.Continuation c)
Returns the total size of the stored data in bytes.The result is returned via the receiveResult method on the provided Continuation with an Integer representing the size.

Parameters:
c - The command to run once the operation is complete

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection