|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityStore
The EntityStore interface defines a common contract for access to all
providers of the EntityStore service.
Field Summary | |
---|---|
static ESPK |
ES_NULL_PK
A key representing a null reference |
static int |
EXPORT_CLOSURE
Used with exportContents(), this flag indicates that any entities which are referred to by exported entities are also exported. |
static int |
EXPORT_ENTITIES
Used with exportContents(), this flag indicates that the entities should be exported. |
static int |
EXPORT_PORTABLE_ESPKS
Used with exportContents(), this flag indicates that the ESPK values for the entities are normalized, allowing import into other ES stores. |
static int |
EXPORT_REALIZED_TYPES
Used with exportContents(), this flag indicates that only types which are instantiated are to be exported. |
static int |
EXPORT_SOFT_REF_CLOSURE
Used with exportContents(), this flag indicates that soft references are followed for closure when the reference can be resolved to another entity. |
static int |
EXPORT_TRUNKS
Used with exportContents(), this flag will ensure all entities leading from the export roots back to the main store root get exported too. |
static int |
EXPORT_TYPES
Used with exportContents(), this flag indicates that the types should be exported. |
static int |
IMPORT_DIRECTIVE_OVERRIDE_ALL
Used with exportContents(), this flag indicates that all exported entities should be flagged with the override directive for subsequent import. |
Fields inherited from interface com.vordel.es.TypeStore |
---|
BASE_TYPE_NAME |
Method Summary | |
---|---|
ESPK |
addEntity(ESPK parentPK,
Entity entity)
Add an Entity to the Store. |
void |
commit()
Indicate that you wish to have all operations on the Store since the last startTransaction committed to the Store, and published to the Store's listeners. |
void |
connect(java.lang.String url,
java.util.Properties credentials)
Connect to an entity store. |
ESPK |
decodePK(java.lang.String stringifiedPK)
Decode a stringified PK as per the implementation. |
void |
deleteEntity(ESPK pk)
Delete an entity from the data store. |
void |
deregisterChangeListener(ESPK entityPK,
ESChangeListener listener)
Deregister from listening to changes to the Entities in the Store. |
void |
disconnect()
Disconnect from the EntityStore. |
void |
exportContents(java.io.OutputStream out,
java.util.Collection<ESPK> startNodes,
int flags)
Export the contents of the entity store to the specified output stream. |
java.util.Collection<ESPK> |
findChildren(ESPK pk,
Field[] fvals,
EntityType ofType)
Find all children of a particular Entity. |
java.util.Collection<ESPK> |
findReferringEntities(ESPK targetEntityPK)
Get a Set of ESPKs which identify all Entities in the store which contain a field or fields which hold a reference to the Entity specified |
Entity |
getEntity(ESPK pk)
Get a particular Entity from the Store, depending on its key. |
Entity |
getEntity(ESPK pk,
java.lang.String[] requiredFieldNames)
Retrieve the subordinate Entities of the identified parent. |
ESPK |
getRootPK()
Get the identifier for the root Entity in the Store. |
java.util.Collection<ESPK> |
importData(java.io.InputStream stream)
Import a serialized definition of the Store. |
void |
initialize()
Connect to the EntityStore and bootstrap the store with the default components required to implement a store. |
java.util.Collection<ESPK> |
listChildren(ESPK pk,
EntityType type)
List all children of a particular Entity. |
void |
registerChangeListener(ESPK entityPK,
ESChangeListener listener)
Register to listen to changes to the Entities in the Store. |
void |
rollback()
Indicate that you wish to discard all changes to the Store since the last startTransaction. |
void |
startTransaction()
Indicate to the Store that you want to start a transaction. |
void |
updateEntity(Entity entity)
Replace an entity |
Methods inherited from interface com.vordel.es.TypeStore |
---|
addType, getBaseType, getSubtypes, getTypeForName, reset, updateType |
Field Detail |
---|
static final int EXPORT_TYPES
static final int EXPORT_ENTITIES
static final int EXPORT_CLOSURE
static final int EXPORT_PORTABLE_ESPKS
static final int EXPORT_REALIZED_TYPES
static final int IMPORT_DIRECTIVE_OVERRIDE_ALL
static final int EXPORT_SOFT_REF_CLOSURE
static final int EXPORT_TRUNKS
static final ESPK ES_NULL_PK
Method Detail |
---|
ESPK getRootPK()
Entity getEntity(ESPK pk) throws EntityStoreException
pk
- The unique identifier for the Entity
EntityStoreException
- If the specified Entity doesn't existEntity getEntity(ESPK pk, java.lang.String[] requiredFieldNames) throws EntityStoreException
pk
- The identifier of the Entities you wish to retrieve.requiredFieldNames
- By specifying this, you can limit the amount of data
actually retreived by the server.
EntityStoreException
ESPK addEntity(ESPK parentPK, Entity entity) throws EntityStoreException
parentPK
- The identifier of the candidate parent Entity to this new Entityentity
- The entity you wish to store.
Entity.getPK()
will return the new identifier
DuplicateKeysException
- If an entity with the same keys already exists in the store.
EntityStoreException
void updateEntity(Entity entity) throws EntityStoreException
entity
- The candidate entity for replacement. The entity must already have
been initialized via a call to getEntity, and its PK will be already
set.
EntityStoreException
void deleteEntity(ESPK pk) throws EntityStoreException
pk
- Identity of the Entity to be deleted
EntityStoreException
java.util.Collection<ESPK> listChildren(ESPK pk, EntityType type) throws EntityStoreException
pk
- The entity id of the parent whose children you wish to listtype
- Indicate the type of children you are interested in. "null"
indicates that you wish to retrieve children of all types.
EntityStoreException
java.util.Collection<ESPK> findChildren(ESPK pk, Field[] fvals, EntityType ofType) throws EntityStoreException
pk
- The entity id of the parent whose children you wish to getfvals
- The Fields (including their values) you wish to do the search on. The
fields can have their data and/or references set.ofType
- Search only for Entities of the specified type.
EntityStoreException
- If the pk is invalid.java.util.Collection<ESPK> findReferringEntities(ESPK targetEntityPK) throws EntityStoreException
targetEntityPK
- The ESPK of the Entity to which other Entities
may refer.
EntityStoreException
void connect(java.lang.String url, java.util.Properties credentials) throws EntityStoreException
url
- The Url of the EntityStore's backend provider.credentials
- A property list of credentials required to connect. Will usually
contain a minimum of a username and password, but may contain other
implementation specific properties, such as key locations for SSL etc.
See the specific implementations of EntityStore for details as to the
contents of these properties.
EntityStoreException
void disconnect() throws EntityStoreException
EntityStoreException
void initialize() throws EntityStoreException
EntityStoreException
- if the underlying implementation cannot
perform its own initialization and relies on external administrative
steps to instantiate the schema components.java.util.Collection<ESPK> importData(java.io.InputStream stream) throws EntityStoreException
stream
- An input stream from which to get the entity/type
definitions
EntityStoreException
void exportContents(java.io.OutputStream out, java.util.Collection<ESPK> startNodes, int flags) throws EntityStoreException
out
- The output stream to output to.startNodes
- An array of the ESPKs which indicate the starting
points of the branches to export.
Null entries and duplicates will be ignored.
A null, zero-length array or array with no usable ESPKs will
result in no Entity data being exported, but types may still be exported
if specified in the flags.flags
- A set of flags to indicate what and how to export.
EntityStoreException
- if the OutputStream is null.void startTransaction() throws EntityStoreException
EntityStoreException
- if the underlying implementation was
unable to start a transactionvoid commit() throws EntityStoreException
EntityStoreException
- If a transaction hasn't been started, or
the underlying implementation was unable to commit.void rollback() throws EntityStoreException
EntityStoreException
- If the underlying implementation was
unable to roll back your changes, or a transaction hasn't been
startedvoid registerChangeListener(ESPK entityPK, ESChangeListener listener) throws EntityStoreException
entityPK
- The Entity PK on which to listen for eventslistener
- The listener for EntityStore change events
EntityStoreException
void deregisterChangeListener(ESPK entityPK, ESChangeListener listener) throws EntityStoreException
entityPK
- The Entity PK from which we no longer listen to eventslistener
- The listener for EntityStore change events, as initially
registered.
EntityStoreException
ESPK decodePK(java.lang.String stringifiedPK) throws EntityStoreException
stringifiedPK
- The string version of the PK
EntityStoreException
|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |