Class ConfigurationUpdate
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
- Direct Known Subclasses:
InitialConfiguration
Configuration information provided by this event is organized
by paths and associated key/value pairs. The path information
should be used by components to select the information important
to them. Often, a component simply matches the path from the event
with its own path in the component hierarchy
(see Manager.componentPath()
). But paths can also be used
to structure information in a way that is completely independent of
the implementation’s structure as the filtering is completely up
to the component.
-
Nested Class Summary
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 TypeMethodDescriptionAdd a new (or updated) configuration value for the given path and key.paths()
Return all paths affected by this event.removePath
(String path) Associate the given path withnull
.Set new (updated), possibly structured configuration values (seeConfigurationStore.structure(Map)
for the given path.structured
(String path) Return the properties for a given path if they exists as a map with (possibly) structured values (seeConfigurationStore.structured(String)
).Return the value with the given path and key if it exists as string.<T> Optional
<T> Return the value with the given path and key if it exists and is of or can be converted to the requested type.Return the properties for a given path if any exist.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
-
ConfigurationUpdate
public ConfigurationUpdate()
-
-
Method Details
-
paths
Return all paths affected by this event.- Returns:
- the paths
-
values
Return the properties for a given path if any exist.If a property has a structured value (list or collection), the values are returned as several entries as described in
ConfigurationStore.flatten(Map)
. All values are converted to their string representation.- Parameters:
path
- the path- Returns:
- the updated values or
null
if the path has been removed (implies the removal of all values for that path).
-
value
Return the value with the given path and key if it exists and is of or can be converted to the requested type.- Type Parameters:
T
- the generic type- Parameters:
path
- the pathkey
- the keyas
- the as- Returns:
- the optional
-
value
Return the value with the given path and key if it exists as string.- Parameters:
path
- the pathkey
- the key- Returns:
- the value
-
structured
Return the properties for a given path if they exists as a map with (possibly) structured values (seeConfigurationStore.structured(String)
).The type of the value depends on the configuration store used. Some configuration stores support types other than string, some don’t. Too avoid any problems, it is strongly recommended to call
ConfigurationStore.as(Object, Class)
for any value obtained from the result of this method.- Parameters:
path
- the path- Returns:
- the updated values or
null
if the path has been removed (implies the removal of all values for that path).
-
set
Set new (updated), possibly structured configuration values (seeConfigurationStore.structure(Map)
for the given path.Any information associated with the path before the invocation of this method is replaced.
- Parameters:
path
- the value’s path- Returns:
- the event for easy chaining
-
add
Add a new (or updated) configuration value for the given path and key.- Parameters:
path
- the value’s pathselector
- the key or the path within the structured valuevalue
- the value- Returns:
- the event for easy chaining
-
removePath
Associate the given path withnull
.This signals to handlers that the path has been removed from the configuration.
- Parameters:
path
- the path that has been removed- Returns:
- the event for easy chaining
-