public interface Chunk<K,V>
extends java.io.Closeable
Modifier and Type | Interface and Description |
---|---|
static class |
Chunk.EmptyChunk<K,V>
An empty implementation of the Chunk interface
|
Modifier and Type | Method and Description |
---|---|
void |
addEventFactory(DeleteEventFactory deleteEventFactory)
Add an DeleteEventFactory to use when generating insert events.
|
void |
addEventFactory(InsertEventFactory insertEventFactory)
Add an InsertEventFactory to use when generating insert events.
|
void |
addEventFactory(QueryEventFactory queryEventFactory)
Add an QueryEventFactory to use when generating insert events.
|
void |
addEventFactory(UpdateEventFactory updateEventFactory)
Add an UpdateEventFactory to use when generating insert events.
|
int |
delete(K key,
DeleteEventFactory<K>... customEventFactory)
Delete a key from this Chunk, returning the number of values deleted.
|
K |
insert(V value,
InsertEventFactory<K,V>... customEventFactory)
Insert a value into this Chunk, returning the key at which the get can be retrieved later.
|
QueryResult<V> |
query(K key,
QueryEventFactory<K,V>... customEventFactory)
Query a key at this Chunk, returning a QueryResult contianing the queried values.
|
void |
setEventDispatcher(EventDispatcher eventDispatcher)
Set the EventDispatcher on this Chunk.
|
int |
update(K key,
V value,
UpdateEventFactory<K,V>... customEventFactory)
Update a key with a value at this Chunk, returning the number of values updated.
|
K insert(V value, InsertEventFactory<K,V>... customEventFactory) throws InsertException
value
- the value to insertcustomEventFactory
- optional InsertEventFactories used to generate events for this operation.InsertException
QueryResult<V> query(K key, QueryEventFactory<K,V>... customEventFactory) throws QueryException
key
- the key to querycustomEventFactory
- optional QueryEventFactories used to generate events for this operation.QueryException
int update(K key, V value, UpdateEventFactory<K,V>... customEventFactory) throws UpdateException
key
- the key to updatevalue
- the value to updatecustomEventFactory
- optional UpdateEventFactories used to generate events for this operation.UpdateException
int delete(K key, DeleteEventFactory<K>... customEventFactory) throws DeleteException
key
- the key to deletecustomEventFactory
- optional DeleteEventFactories used to generate events for this operation.DeleteException
void setEventDispatcher(EventDispatcher eventDispatcher)
Operations on this Chunk will dispatch events to the given EventDispatcher. The events dispatched are generated by EventFactories that are either previously added to this Chunk, or else passed in as a parameter to the Chunk operation.
eventDispatcher
- The EventDispatcher to be used for events on this Chunk.void addEventFactory(InsertEventFactory insertEventFactory)
void addEventFactory(QueryEventFactory queryEventFactory)
void addEventFactory(UpdateEventFactory updateEventFactory)
void addEventFactory(DeleteEventFactory deleteEventFactory)