Class UpdateConletModel
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
The interpretation of the properties is completely dependent on the handling web console component.
This event has a close relationship to the NotifyConletModel
event. The latter is used by web console component’s functions to
send information from the console page to the web console component
model. The interpretation of this information is only known by the web
console component. The UpdateConletModel
event should be
used to to pass information within the application, i.e. on the server
side.
Depending on the information passed, it may be good practice to
write an event handler for the web console component that converts a
NotifyConletModel
to a UpdateConletModel
that is
fired on its channel instead of handling it immediately. This allows
events sent from the console page and from other components in the
application to be handled in a uniform way.
-
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
ConstructorDescriptionUpdateConletModel
(String conletId) Creates a new event.UpdateConletModel
(String conletId, Map<?, ?> properties) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionaddPreference
(Object key, Object value) Convenience method for adding properties one-by-one.conletId()
Returns the web console component id.ifPresent
(Object key, BiConsumer<Object, Object> action) Convenience method that performs the given action if a property with the given key exists.Returns the properties.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
-
UpdateConletModel
Creates a new event.- Parameters:
conletId
- the id of the web console componentproperties
- the properties to update
-
UpdateConletModel
Creates a new event.This constructor creates an empty map of properties and is therefore intended to be used together with
addPreference(Object, Object)
.- Parameters:
conletId
- the web console component id
-
-
Method Details
-
conletId
Returns the web console component id.- Returns:
- the web console component id
-
properties
Returns the properties.Every event returns a mutable map, thus allowing event handlers to modify the map even if none was passed to the constructor.
-
addPreference
Convenience method for adding properties one-by-one.- Parameters:
key
- the property keyvalue
- the property value- Returns:
- the event for easy chaining
-
ifPresent
Convenience method that performs the given action if a property with the given key exists.- Parameters:
key
- the property keyaction
- the action to perform
-