public class EventPublishingDataStore<K,E> extends Object implements DataStore<K,E>, DataStoreEventPublisher
| Constructor and Description |
|---|
EventPublishingDataStore(DataStore<K,E> delegate,
RepositoryMetadata repositoryMetadata,
DataStoreEventListenerContext listenerContext) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(K key)
Deletes the entity identifiable with the provided key, or does nothing if no such entity
exists.
|
Class<E> |
getEntityType() |
boolean |
hasKey(K key)
Determines whether or not an entity with the given key exists in the data store.
|
Collection<K> |
keys() |
void |
publishEvent(DataStoreEvent event)
This method is called to publish a data store event
|
E |
retrieve(K key)
Given a key, retrieves the entity associated with that key in the data store.
|
Collection<E> |
retrieveAll() |
boolean |
save(K key,
E entity)
Saves the given entity into the data store under the provided key.
|
void |
truncate()
Does a hard remove of all the entities in the data store
|
public EventPublishingDataStore(DataStore<K,E> delegate, RepositoryMetadata repositoryMetadata, DataStoreEventListenerContext listenerContext)
public boolean hasKey(K key)
DataStorepublic boolean save(K key, E entity)
DataStoreDataStore.hasKey(Object) should
yield true and the very same entity (or an equal value entity) can be retrieved by
calling DataStore.retrieve(Object).public boolean delete(K key)
DataStoreDataStore.hasKey(Object) should return false and DataStore.retrieve(Object) should return
null for the same key.public E retrieve(K key)
DataStorepublic Collection<K> keys()
public Collection<E> retrieveAll()
retrieveAll in interface DataStore<K,E>public Class<E> getEntityType()
getEntityType in interface DataStore<K,E>public void truncate()
DataStorepublic void publishEvent(DataStoreEvent event)
DataStoreEventPublisherpublishEvent in interface DataStoreEventPublisherevent - the event that should be publishedCopyright © 2014–2021. All rights reserved.