Package org.jgrapes.util.events
Class KeyValueStoreUpdate
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
An event that triggers updates or deletions in a key/value store.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The base class for all actions.static class
A key (and value) deletion.static class
A value update.Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactions()
Returns the actions.Adds a new deletion action that clears all keys with the given path prefix.Adds a new deletion action to the event.Adds a new update action to the event that stores the given value on the path formed by the path segments.Adds a new update action to the event.Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo, toString
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
KeyValueStoreUpdate
public KeyValueStoreUpdate()
-
-
Method Details
-
update
Adds a new update action to the event.- Parameters:
key
- the keyvalue
- the value- Returns:
- the event for easy chaining
-
storeAs
Adds a new update action to the event that stores the given value on the path formed by the path segments.- Parameters:
value
- the valuesegments
- the path segments- Returns:
- the event for easy chaining
-
delete
Adds a new deletion action to the event.- Parameters:
key
- the key- Returns:
- the event for easy chaining
-
clearAll
Adds a new deletion action that clears all keys with the given path prefix.- Parameters:
segments
- the path segments- Returns:
- the event for easy chaining
-
actions
Returns the actions.- Returns:
- the actions
-