|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectStoreService
An ObjectStoreService is mainly used in SMILA to store binary data during bulk processing. Data objects in this
service are for example big bulks of records that are to be processed in a single step by some worker. Of course, the
ObjectStoreService can also be used to store small objects like record attachments or other auxiliary data. Apart
from reading and writing objects (either as blobs or using streams), blobs can be appended to objects, objects can be
removed, and it is possible to get a list of descriptions (StoreObject
) about the current objects in a store,
optionally filtered by a prefix string on the object ID.
Objects are identified by a String
identifiers. All implementations must support these chars::
Field Summary | |
---|---|
static java.lang.String |
KEY_OBJECT_COUNT
key of store object count of the store info. |
static java.lang.String |
KEY_OBJECTS
key of store objects of the store info. |
static java.lang.String |
KEY_SIZE
key of store size of the store info. |
static java.lang.String |
KEY_STORE_NAME
key of store name of the store info. |
static java.lang.String |
KEY_STORE_PROPERTIES
key of store properties of the store info. |
Method Summary | |
---|---|
void |
appendToObject(java.lang.String storeName,
java.lang.String objectId,
byte[] data)
append the data to the given store and object. |
void |
clearStore(java.lang.String storeName)
Remove all objects from the named store. |
long |
countStoreObjects(java.lang.String storeName,
java.lang.String objectIdPrefix)
Count all current objects in the named store that have an ID that starts with the given prefix. |
void |
createStore(java.lang.String storeName,
AnyMap storeProperties)
Creates a store with the given configuration properties. |
void |
ensureStore(java.lang.String storeName)
Ensures that a store with the given name existing, regardless of the exact configuration properties. |
boolean |
existsObject(java.lang.String storeName,
java.lang.String objectId)
|
boolean |
existsStore(java.lang.String storeName)
|
void |
finishObject(java.lang.String storeName,
java.lang.String objectId)
Prevent further append calls to this object. |
byte[] |
getObject(java.lang.String storeName,
java.lang.String objectId)
get the complete content of an object. |
StoreObject |
getObjectInfo(java.lang.String storeName,
java.lang.String objectId)
get information about a single object. |
java.util.Collection<java.lang.String> |
getPrefixes(java.lang.String storeName,
java.lang.String objectIdPrefix)
Get all prefixes of objectIds (this can also include complete ObjectIds) in the named store that have an ID that starts with the given prefix until the next separator (/). |
AnyMap |
getStoreInfo(java.lang.String storeName,
boolean includeObjectInfos)
get a description of the current store state to be displayed in administration tools (e.g. by an Http handler). |
java.util.Collection<java.lang.String> |
getStoreNames()
|
java.util.Collection<StoreObject> |
getStoreObjectInfos(java.lang.String storeName)
Get information about all current objects in the named store. |
java.util.Collection<StoreObject> |
getStoreObjectInfos(java.lang.String storeName,
java.lang.String objectIdPrefix)
Get information about all current objects in the named store that have an ID that starts with the given prefix. |
AnyMap |
getStoreProperties(java.lang.String storeName)
get configuration properties of the named store. |
boolean |
isValidStoreName(java.lang.String storeName)
Check if the argument is a valid store name for this service implementation. |
void |
putObject(java.lang.String storeName,
java.lang.String objectId,
byte[] data)
write the data to the given store and object. |
java.io.InputStream |
readObject(java.lang.String storeName,
java.lang.String objectId)
get a stream for reading the object content. |
void |
removeAllStores()
remove all stores from the service. |
void |
removeObject(java.lang.String storeName,
java.lang.String objectId)
remove the object from the store. |
void |
removeObjects(java.lang.String storeName,
java.lang.String objectIdPrefix)
remove all objects from the store with an ID starting with the given prefix. |
void |
removeStore(java.lang.String storeName)
remove a store completely, if it exists. |
StoreOutputStream |
writeObject(java.lang.String storeName,
java.lang.String objectId)
open a stream for creating a data object and writing it. |
Field Detail |
---|
static final java.lang.String KEY_STORE_NAME
static final java.lang.String KEY_STORE_PROPERTIES
static final java.lang.String KEY_OBJECT_COUNT
static final java.lang.String KEY_SIZE
static final java.lang.String KEY_OBJECTS
Method Detail |
---|
java.util.Collection<java.lang.String> getStoreNames() throws ObjectStoreException
ObjectStoreException
- on error.void createStore(java.lang.String storeName, AnyMap storeProperties) throws ObjectStoreException
null
, the service chooses
default properties on its own.
storeName
- name of store to createstoreProperties
- store configuration, may be null.
InvalidStoreNameException
- if the store name is not valid.
StoreExistsException
- if a store with this name exists already.
ObjectStoreException
- other errors.void ensureStore(java.lang.String storeName) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
ObjectStoreException
- other errorsboolean isValidStoreName(java.lang.String storeName)
boolean existsStore(java.lang.String storeName) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
ObjectStoreException
- some error.void removeStore(java.lang.String storeName) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
ObjectStoreException
- error deleting the store.java.util.Collection<StoreObject> getStoreObjectInfos(java.lang.String storeName) throws ObjectStoreException
StoreObject
s
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error determining the object info list.java.util.Collection<StoreObject> getStoreObjectInfos(java.lang.String storeName, java.lang.String objectIdPrefix) throws ObjectStoreException
StoreObject
s with IDs matching the prefix.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error determining the object info list.long countStoreObjects(java.lang.String storeName, java.lang.String objectIdPrefix) throws ObjectStoreException
StoreObject
s with IDs matching the prefix.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error determining the object info list.java.util.Collection<java.lang.String> getPrefixes(java.lang.String storeName, java.lang.String objectIdPrefix) throws ObjectStoreException
String
s with IDs matching the prefix.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error determining the object info list.AnyMap getStoreProperties(java.lang.String storeName) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
ObjectStoreException
- error reading store properties.AnyMap getStoreInfo(java.lang.String storeName, boolean includeObjectInfos) throws ObjectStoreException
includeObjectInfos == true
. It
can contain additional information.
includeObjectInfos
- set to true to include the list of current object infos in the result.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error reading store properties.byte[] getObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
NoSuchObjectException
- if the object does not exist
ObjectStoreException
- other error reading the objectjava.io.InputStream readObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
NoSuchObjectException
- if the object does not exist
ObjectStoreException
- other error reading the objectvoid putObject(java.lang.String storeName, java.lang.String objectId, byte[] data) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- other error reading the objectvoid appendToObject(java.lang.String storeName, java.lang.String objectId, byte[] data) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- other error reading the objectvoid finishObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
appendToObject(String, String, byte[])
. The operation is optional:
An implementation may choose not to support it, in this case it should just ignore the call and not throw an
exception. However, in some pathological situations this may lead to data loss, because data could be appended for
processing when the object is already considered as finished and the next processing steps have been started and
miss the latest appends.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
StoreOutputStream writeObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
StoreOutputStream.abort()
before
closing the stream.
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error creating the object.boolean existsObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error checking object existence.void removeObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error removing the object.void removeObjects(java.lang.String storeName, java.lang.String objectIdPrefix) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist
ObjectStoreException
- error removing the object.StoreObject getObjectInfo(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist.
NoSuchObjectException
- if the object does not exist in the store.
ObjectStoreException
- error reading the object info.void removeAllStores() throws ObjectStoreException
ObjectStoreException
- error removing the data.void clearStore(java.lang.String storeName) throws ObjectStoreException
InvalidStoreNameException
- if the store name is not valid.
NoSuchStoreException
- if the store does not exist.
ObjectStoreException
- error clearing the store.
|
SMILA 1.0 API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |