T - the type the storage ought to be restrictedC - the type of configuration this type of storage needspublic interface Storage<T,C extends StorageConf>
| Modifier and Type | Method and Description |
|---|---|
void |
delete(T object) |
C |
getStorageConf() |
boolean |
isStarted() |
void |
refresh(Object object) |
void |
registerPostStoreCallback(T object,
StorageCallback callback)
Registers a callback which is executed right after
object is
stored with store(java.lang.Object). |
void |
registerPreStoreCallback(T object,
StorageCallback callback)
Registers a callback which is executed right before
object is
stored with store(java.lang.Object). |
<U extends T> |
retrieve(Object id,
Class<U> clazz)
Retrieves the instance with ID
id of type clazz from
storage. |
void |
shutdown()
Frees eventually aquired resources.
|
void |
start()
Starts referenced resources.
|
void |
store(T object) |
void |
update(T object) |
void delete(T object) throws StorageException
StorageExceptionvoid store(T object) throws StorageException
StorageException<U extends T> U retrieve(Object id, Class<U> clazz) throws StorageException
id of type clazz from
storage.U - allows enforcing a subtype of the type of the storage via the
clazz parameterid - clazz - StorageException - wraps any exception occuring during storagevoid update(T object) throws StorageException
StorageExceptionvoid refresh(Object object) throws StorageException
StorageExceptionvoid start()
throws StorageCreationException
StorageCreationException - wraps any exception which occurs during the creation of this storageboolean isStarted()
void shutdown()
C getStorageConf()
void registerPostStoreCallback(T object, StorageCallback callback) throws StorageException
object is
stored with store(java.lang.Object).
Note that entities are supposed to be equals in all persistent entity
states transient, attached, detached and removedhttps://vladmihalcea.com/2014/07/30/a-beginners-guide-to-jpahibernate-entity-state-transitions/
and if they're not this method will explicitly has undefined behaviour.object - the object the callback ought to be registered forcallback - the callback to registerStorageException - wraps any exception occuring during storagevoid registerPreStoreCallback(T object, StorageCallback callback) throws StorageException
object is
stored with store(java.lang.Object).
Note that entities are supposed to be equals in all persistent entity
states transient, attached, detached and removedhttps://vladmihalcea.com/2014/07/30/a-beginners-guide-to-jpahibernate-entity-state-transitions/
and if they're not this method will explicitly has undefined behaviour.object - the object the callback ought to be registered forcallback - the callback to registerStorageException - wraps any exception occuring during storageCopyright © 2018. All rights reserved.