|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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(Id id)
Returns whether or not an object is present in the location id
. |
void |
flush(Continuation c)
Method which is used to erase all data stored in the Catalog. |
java.io.Serializable |
getMetadata(Id id)
Returns the metadata associated with the provided object, or null if no metadata exists. |
void |
getObject(Id id,
Continuation c)
Returns the object identified by the given id, or null if
there is no cooresponding object (through receiveResult on c). |
int |
getSize()
Returns the number of Ids currently stored in the catalog |
long |
getTotalSize()
Returns the total size of the stored data in bytes. |
void |
rename(Id oldId,
Id newId,
Continuation c)
Renames the given object to the new id. |
IdSet |
scan()
Return all objects currently stored by this catalog NOTE: This method blocks so if the behavior of this method changes and no longer stored in memory, this method may be deprecated. |
IdSet |
scan(IdRange range)
Return the objects identified by the given range of ids. |
java.util.SortedMap |
scanMetadata()
Returns a map which contains keys mapping ids to the associated metadata. |
java.util.SortedMap |
scanMetadata(IdRange range)
Returns a map which contains keys mapping ids to the associated metadata. |
java.util.SortedMap |
scanMetadataValuesHead(java.lang.Object value)
Returns the submapping of ids which have metadata less than the provided value. |
java.util.SortedMap |
scanMetadataValuesNull()
Returns the submapping of ids which have metadata null |
void |
setMetadata(Id id,
java.io.Serializable metadata,
Continuation command)
Updates the metadata stored under the given key to be the provided value. |
Method Detail |
public boolean exists(Id id)
id
.
id
- The id of the object in question.
public void getObject(Id id, Continuation c)
null
if
there is no cooresponding object (through receiveResult on c).
id
- The id of the object in question.c
- The command to run once the operation is completepublic java.io.Serializable getMetadata(Id id)
id
- The id for which the metadata is needed
public void setMetadata(Id id, java.io.Serializable metadata, Continuation command)
id
- The id for the metadatametadata
- The metadata to storecommand
- The new Metadata valuepublic void rename(Id oldId, Id newId, Continuation c)
oldId
- The id of the object in question.newId
- The new id of the object in question.c
- The command to run once the operation is completepublic IdSet scan(IdRange range)
range
- The range to query
public IdSet scan()
public java.util.SortedMap scanMetadata(IdRange range)
range
- The range to query
public java.util.SortedMap scanMetadata()
public java.util.SortedMap scanMetadataValuesHead(java.lang.Object value)
value
- The maximal metadata value
public java.util.SortedMap scanMetadataValuesNull()
public int getSize()
public long getTotalSize()
public void flush(Continuation c)
c
- The command to run once done
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |