public interface ModelObjectPersister
| Modifier and Type | Method and Description |
|---|---|
Map<String,ModelObject> |
getAllObjects(ModelPersistenceContext context,
String objectTypeId)
Returns a map of all of the objects referenced by this persister.
|
Map<String,ModelObject> |
getAllObjectsByFilter(ModelPersistenceContext context,
String objectTypeId,
String objectIdPattern)
Returns a map of all of the objects referenced by this persister filtered by
the given ID filter.
|
String |
getId()
Returns a unique id for this persister
If this persister is wrapped around a ClassPath store,
a LocalFileSystem store or a Repository store, this will return
the value provided getBasePath()
If this is wrapped around a RemoteStore, this will return the
AVM Store ID to which this persister is bound
|
ModelObject |
getObject(ModelPersistenceContext context,
String objectTypeId,
String objectId)
Gets an object from persisted storage by id
|
long |
getTimestamp(ModelPersistenceContext context,
String objectTypeId,
String objectId)
Returns the timestamp of the given object in the underlying store
|
boolean |
hasObject(ModelPersistenceContext context,
ModelObject object)
Checks whether the given object is persisted
|
boolean |
hasObject(ModelPersistenceContext context,
String objectTypeId,
String objectId)
Checks whether an object with the given path is persisted
|
boolean |
hasReadOnlyStore()
Indicates whether or not the persister uses a store that is read only.
|
void |
init(ModelPersistenceContext context)
Initializes the persister by preloading the object cache
|
boolean |
isEnabled()
Indicates whether this persisted is currently enabled.
|
ModelObject |
newObject(ModelPersistenceContext context,
String objectTypeId,
String objectId)
Creates a new object
|
boolean |
removeObject(ModelPersistenceContext context,
ModelObject object)
Removes an object from persisted storage
|
boolean |
removeObject(ModelPersistenceContext context,
String objectTypeId,
String objectId)
Removes an object from persisted storage
|
void |
reset()
Resets the persister, clearing cache and starting anew.
|
boolean |
saveObject(ModelPersistenceContext context,
ModelObject object)
Saves an object to persisted storage
|
boolean |
saveObjects(ModelPersistenceContext context,
List<ModelObject> objects)
Saves a collection of objects to persisted storage
|
void init(ModelPersistenceContext context)
context - the persistence contextvoid reset()
String getId()
ModelObject getObject(ModelPersistenceContext context, String objectTypeId, String objectId) throws ModelObjectPersisterException
context - ModelPersistenceContextobjectTypeId - StringobjectId - StringModelObjectPersisterExceptionboolean saveObject(ModelPersistenceContext context, ModelObject object) throws ModelObjectPersisterException
context - ModelPersistenceContextobject - ModelObjectModelObjectPersisterExceptionboolean saveObjects(ModelPersistenceContext context, List<ModelObject> objects) throws ModelObjectPersisterException
context - ModelPersistenceContextobjects - ListModelObjectPersisterExceptionboolean removeObject(ModelPersistenceContext context, ModelObject object) throws ModelObjectPersisterException
context - ModelPersistenceContextobject - ModelObjectModelObjectPersisterExceptionboolean removeObject(ModelPersistenceContext context, String objectTypeId, String objectId) throws ModelObjectPersisterException
context - ModelPersistenceContextobjectTypeId - StringobjectId - StringModelObjectPersisterExceptionboolean hasObject(ModelPersistenceContext context, ModelObject object) throws ModelObjectPersisterException
context - ModelPersistenceContextobject - ModelObjectModelObjectPersisterExceptionboolean hasObject(ModelPersistenceContext context, String objectTypeId, String objectId) throws ModelObjectPersisterException
context - ModelPersistenceContextobjectTypeId - StringobjectId - StringModelObjectPersisterExceptionModelObject newObject(ModelPersistenceContext context, String objectTypeId, String objectId) throws ModelObjectPersisterException
context - ModelPersistenceContextobjectTypeId - StringobjectId - StringModelObjectPersisterExceptionMap<String,ModelObject> getAllObjects(ModelPersistenceContext context, String objectTypeId) throws ModelObjectPersisterException
In general, this is a very expensive call and should be avoided. Each object descriptor referenced by the persister is loaded into the model object cache.
context - ModelPersistenceContextobjectTypeId - StringModelObjectPersisterExceptionMap<String,ModelObject> getAllObjectsByFilter(ModelPersistenceContext context, String objectTypeId, String objectIdPattern) throws ModelObjectPersisterException
In general, this is an expensive call but less expensive than getAllObjects(). Each object descriptor referenced by the persister found using the filter is loaded into the model object cache.
context - ModelPersistenceContextobjectTypeId - StringobjectIdPattern - StringModelObjectPersisterExceptionlong getTimestamp(ModelPersistenceContext context, String objectTypeId, String objectId) throws ModelObjectPersisterException
context - ModelPersistenceContextobjectTypeId - StringobjectId - StringModelObjectPersisterExceptionboolean isEnabled()
boolean hasReadOnlyStore()
Copyright © 2005–2016 Alfresco Software. All rights reserved.