public abstract class AbstractResourceEventStore extends Object implements ResourceEventStore
Constructor and Description |
---|
AbstractResourceEventStore() |
Modifier and Type | Method and Description |
---|---|
void |
corrupt()
Forces the corruption of this resource event store.
|
Collection<ResourceEvent> |
getAll()
Returns the stored
resource events . |
protected abstract StreamingStorage |
getStorage()
Returns the underlying resource events storage.
|
protected abstract Executor |
getSynchronizer()
Returns an executor that guarantees runnable instances handling data related to this store
are never executed concurrently but one at a time across the whole web application.
|
Collection<ResourceEvent> |
removeAll()
Removes and return all stored
resource events . |
void |
restore()
Restores the store's state to the starting stage.
|
protected abstract void |
setCorrupted(boolean corrupted)
Changes the corrupted state of the store.
|
void |
store(ResourceEvent resourceEvent)
Stores a
resource event . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isCorrupted
protected abstract StreamingStorage getStorage()
public void corrupt()
Store
protected abstract void setCorrupted(boolean corrupted)
corrupted
- true
if the store becomes corrupted;false
otherwise.protected abstract Executor getSynchronizer() throws IOException
IOException
- if an executor cannot be created.public void restore() throws TrsStoreException
Store
restore
in interface Store
TrsStoreException
- if the storage cannot be reestablished to its original state.public void store(ResourceEvent resourceEvent)
ResourceEventStore
resource event
.store
in interface ResourceEventStore
resourceEvent
- the event to store.public Collection<ResourceEvent> getAll()
ResourceEventStore
resource events
.getAll
in interface ResourceEventStore
public Collection<ResourceEvent> removeAll()
ResourceEventStore
resource events
.
The store is empty once this method is called.removeAll
in interface ResourceEventStore