Class StatusCache
java.lang.Object
de.iip_ecosphere.platform.configuration.cfg.StatusCache
Simple pre-processing cache of
StatusMessage for UI display.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDenotes the state of a service on a certain device. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<de.iip_ecosphere.platform.transport.status.StatusMessage> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionensureServicePerDevice(de.iip_ecosphere.platform.transport.status.StatusMessage message) Ensures the existence of a device-state map for the service messagemessage.static voidgetServiceStates(String sId, Consumer<StatusCache.ServiceDeviceState> consumer) Returns the states of servicesIdon all known devices.private static voidhandleServiceStateChange(de.iip_ecosphere.platform.transport.status.StatusMessage message) Handles a service state change.static voidstart()Starts the status cache.static voidstop()Stops the status cache.
-
Field Details
-
serviceStates
-
statusCallback
private static de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<de.iip_ecosphere.platform.transport.status.StatusMessage> statusCallback
-
-
Constructor Details
-
StatusCache
public StatusCache()
-
-
Method Details
-
ensureServicePerDevice
private static Map<String,String> ensureServicePerDevice(de.iip_ecosphere.platform.transport.status.StatusMessage message) Ensures the existence of a device-state map for the service messagemessage.- Parameters:
message- the message- Returns:
- the device-state map
-
handleServiceStateChange
private static void handleServiceStateChange(de.iip_ecosphere.platform.transport.status.StatusMessage message) Handles a service state change.- Parameters:
message- the message indicating the service status change
-
getServiceStates
Returns the states of servicesIdon all known devices. If a device is not mentioned, the service is not running there.- Parameters:
sId- the service idconsumer- a consumer receiving the data
-
start
public static void start()Starts the status cache. -
stop
public static void stop()Stops the status cache.
-