public interface InterpretationGroup
GROUP_NAME specifying the
id of the interpretation group. There must be exactly one service registration for particular interpretation group.
Interpretation Groups is feature of the Operation Manager, that allows command interpreters
(control unit providers and interpreters of custom command) to be logically grouped.
Interpreters of different commands could participate in common interpreter group.
Interpreter groups provide special behavior of command executions:
Inside an operation execution that contains a list of commands to be started, the chunks of commands
for a given interpretation group will not be started until the previous chunk for different interpretation
group has finished.
When a chunk of commands for a given interpretation group is to be started, the group provider is
asked whether the particular device is currently ready to execute commands of the particular group.
(See: isDeviceReadyToExecute(String, String)).
For example, a device representation may define group of commands that are to be executed directly on the backend without
participation of the client-device side, and another group of commands that are to be sent for interpretation to
the client device. The second group of commands can not be executed of the device is not currently connected to the backend,
while the first one is always ready to execute.
The filters applied to each command, are not evaluated against a target device if currently the device is not ready to execute
the command of the respective interpretation group.
When commands of given interpretation group are forwarded to the interpreters (i.e. the system invokes
invokeAction to the control unit providers or executeCommand to the custom command interpreters),
they may not start immediately the interpretation, but may buffer the command job in an interpretation context object
and start the whole chunk of commands for their common interpretation group at once. This is useful for commands
that are to be sent for interpretation to the client device. When the current chunk of commands from a single interpretation group
are forwarded to the interpreters, the system invokes the flush(String, String, String, Object) command of the
respective interpretation group. Thus, the provider can send the whole command chunk at once, instead of performing multiple remote
calls to the target device. Interpreters buffer the command job in an interpretation context object inside the
InterpretationResult passed for interpretation.
InterpretationResult.setInterpretationContext(Object)
InterpretationResult.getInterpretationContext()
Command interpreters (control unit providers and interpreters of custom commands) may register as participants of
particular interpretation group by adding the service property GROUP_NAME to their service registrations.
For providers that need to register different control unit actions of the same control unit type under separate
interpretation groups, the system allows registration of CommandInterpreter
service that undertake the interpretation of control unit commands. The interpreter may register to undertake a specific set
of control unit actions by adding a service property
CommandInterpreter.CONTROL_UNIT_ACTIONS
to its service registration. By combination with the GROUP_NAME registration property, different control unit actions
if the same control unit type may be registered under separate interpretation groups.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
GROUP_NAME
The property key, this service should be registered with, specifying the id of the interpretation group.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush(java.lang.String operationId,
java.lang.String deviceType,
java.lang.String deviceId,
java.lang.Object interpretationContext)
Invoked by the system at the end of launching a chunk of commands registered for this interpretation group.
|
boolean |
isDeviceReadyToExecute(java.lang.String deviceType,
java.lang.String deviceId)
Invoked by the system to check if a particular device is ready to execute commands for this interpretation group.
|
static final java.lang.String GROUP_NAME
boolean isDeviceReadyToExecute(java.lang.String deviceType,
java.lang.String deviceId)
deviceType - device type.deviceId - device id.true if the device is ready to execute commands of this interpretation group, false otherwise.void flush(java.lang.String operationId,
java.lang.String deviceType,
java.lang.String deviceId,
java.lang.Object interpretationContext)
operationId - operation id.deviceType - device type.deviceId - device id.interpretationContext - interpretaion context with all command jobs buffered by the providers.Copyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.