ePOST API

rice.persistence
Interface Storage

All Superinterfaces:
Catalog
All Known Subinterfaces:
StorageManager
All Known Implementing Classes:
MemoryStorage, PersistentStorage, StorageManagerImpl

public interface Storage
extends Catalog

This interface is the abstraction of something which provides a local storage service, such as a persistence storage service or an in-memory storage service. Two implementations are provided, the PersistentStorage and MemoryStorage, respsectively.


Method Summary
 void store(Id id, java.io.Serializable metadata, java.io.Serializable obj, Continuation c)
          Stores an object in this storage.
 void unstore(Id id, Continuation c)
          Removes the object from the list of stored objects.
 
Methods inherited from interface rice.persistence.Catalog
exists, flush, getMetadata, getObject, getSize, getTotalSize, rename, scan, scan, scanMetadata, scanMetadata, scanMetadataValuesHead, scanMetadataValuesNull, setMetadata
 

Method Detail

store

void store(Id id,
           java.io.Serializable metadata,
           java.io.Serializable obj,
           Continuation c)
Stores an object in this storage. This method is non-blocking. If the object has already been stored at the location id, this method has the effect of calling unstore(id) followed by store(id, obj). This method finishes by calling receiveResult() on the provided continuation with the success or failure of the store. Returns True if the action succeeds, else False (through receiveResult on c).

Parameters:
id - The object's id.
metadata - The object's metadata
obj - The object to store.
c - The command to run once the operation is complete

unstore

void unstore(Id id,
             Continuation c)
Removes the object from the list of stored objects. This method is non-blocking. If the object was not in the stored list in the first place, nothing happens and False is returned. Returns True if the action succeeds, else False (through receiveResult on c).

Parameters:
pid - The object's persistence id
c - The command to run once the operation is complete

ePOST API

Copyright © 2001-2005 - Rice Pastry.