org.elkoserver.objdb.store
Interface ObjectStore

All Known Implementing Classes:
FileObjectStore, MongoObjectStore

public interface ObjectStore

Access to a persistent object data storage mechanism.

This interface is used by both the Repository (which provides object storage remotely via a JSON protocol) and ObjDBLocal (which provides object storage locally via direct access to an object database). In either case, they are configured with the fully qualified class name of an implementor of this interface, which they instantiate at startup time.


Method Summary
 void getObjects(RequestDesc[] what, GetResultHandler handler)
          Service a 'get' request.
 void initialize(BootProperties props, String propRoot, Trace trace)
          Do whatever initialization is required to begin serving objects.
 void putObjects(PutDesc[] what, RequestResultHandler handler)
          Service a 'put' request.
 void queryObjects(QueryDesc[] what, GetResultHandler handler)
          Service a 'query' request.
 void removeObjects(RequestDesc[] what, RequestResultHandler handler)
          Service a 'remove' request.
 void shutdown()
          Do any work required immediately prior to shutting down the server.
 void updateObjects(UpdateDesc[] what, RequestResultHandler handler)
          Service an 'update' request.
 

Method Detail

initialize

void initialize(BootProperties props,
                String propRoot,
                Trace trace)
Do whatever initialization is required to begin serving objects. This method gets invoked once, at server startup time.

Parameters:
props - Properties describing configuration information.
propRoot - Prefix string for selecting relevant properties.
trace - Trace object for use in logging.

getObjects

void getObjects(RequestDesc[] what,
                GetResultHandler handler)
Service a 'get' request. This is a request to retrieve one or more objects from the store.

Parameters:
what - The objects sought.
handler - Object to receive results (i.e., the objects retrieved or failure indicators), when available.

queryObjects

void queryObjects(QueryDesc[] what,
                  GetResultHandler handler)
Service a 'query' request. This is a request to query one or more objects from the store.

Parameters:
what - Query templates for the objects sought.
handler - Object to receive results (i.e., the objects retrieved or failure indicators), when available.

putObjects

void putObjects(PutDesc[] what,
                RequestResultHandler handler)
Service a 'put' request. This is a request to write one or more objects to the store.

Parameters:
what - The objects to be written.
handler - Object to receive results (i.e., operation success or failure indicators), when available.

removeObjects

void removeObjects(RequestDesc[] what,
                   RequestResultHandler handler)
Service a 'remove' request. This is a request to delete one or more objects from the store.

Parameters:
what - The objects to be removed.
handler - Object to receive results (i.e., operation success or failure indicators), when available.

shutdown

void shutdown()
Do any work required immediately prior to shutting down the server. This method gets invoked at most once, at server shutdown time.


updateObjects

void updateObjects(UpdateDesc[] what,
                   RequestResultHandler handler)
Service an 'update' request. This is a request to write one or more objects to the store, subject to a version number check to assure atomicity.

Parameters:
what - The objects to be written.
handler - Object to receive results (i.e., operation success or failure indicators), when available.