|
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--rice.persistence.MemoryStorage
This class is an implementation of Storage which provides in-memory storage. This class is specifically *NOT* designed to provide persistent storage, and simply functions as an enhanced hash table.
| Constructor Summary | |
MemoryStorage(rice.p2p.commonapi.IdFactory factory)
Builds a MemoryStorage object. |
|
| Method Summary | |
boolean |
exists(rice.p2p.commonapi.Id id)
Returns whether or not the provided id exists |
void |
exists(rice.p2p.commonapi.Id id,
rice.Continuation c)
Returns whether or not the provided id exists, by returning a Boolean through receiveResult on c |
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. |
void |
store(rice.p2p.commonapi.Id id,
java.io.Serializable obj,
rice.Continuation c)
Stores the object under the key id. |
void |
unstore(rice.p2p.commonapi.Id id,
rice.Continuation c)
Removes the object from the list of stored objects. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MemoryStorage(rice.p2p.commonapi.IdFactory factory)
factory - The factory to build protocol-specific Ids from.| Method Detail |
public void store(rice.p2p.commonapi.Id id,
java.io.Serializable obj,
rice.Continuation c)
id. If there is already
an object under id, that object is replaced.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
store in interface Storageobj - The object to be made persistent.id - The object's id.c - The command to run once the operation is complete
true if the action succeeds, else
false.
public void unstore(rice.p2p.commonapi.Id id,
rice.Continuation c)
false
is returned.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
unstore in interface Storageid - The object's persistence idc - The command to run once the operation is complete
true if the action succeeds, else
false.public boolean exists(rice.p2p.commonapi.Id id)
exists in interface Catalogid - The id to check
public void exists(rice.p2p.commonapi.Id id,
rice.Continuation c)
exists in interface Catalogid - The id to checkc - The command to run once the result is available
public void getObject(rice.p2p.commonapi.Id id,
rice.Continuation c)
null if
there is no cooresponding object (through receiveResult on c).
getObject in interface Catalogid - The id of the object in question.c - The command to run once the operation is complete
public void scan(rice.p2p.commonapi.IdRange range,
rice.Continuation c)
scan in interface Catalogc - The command to run once the operation is completepublic rice.p2p.commonapi.IdSet scan(rice.p2p.commonapi.IdRange range)
scan in interface Catalogrange - The range to query
public void getTotalSize(rice.Continuation c)
getTotalSize in interface Catalogc - The command to run once the operation is complete
|
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||