Interface InstructionHandler
- All Known Implementing Classes:
DefaultDatumService,DefaultOperationalModesService,SimpleNodeControlsService,SimpleNodeSettingsService
- Version:
- 2.2
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn instruction parameter for an identifier.static final StringAn instruction parameter for a message.static final StringAn instruction parameter for a service name.static final StringAn instruction parameter for a service argument.static final StringAn instruction parameter for a service result.static final StringAn instruction parameter for a status code.static final StringThe instruction topic to cancel an instruction.static final StringThe instruction topic for balancing power generation to power demand.static final StringThe instruction topic for setting control parameters.static final StringThe instruction topic for a request to change theDeviceOperatingStateof a device.static final StringThe instruction topic for a request to reduce power demand.static final StringThe instruction topic for a request to signal a control or device.static final StringThe instruction topic for obtaining system configuration.static final StringThe instruction topic for applying system configuration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhandlesTopic(String topic) Test if a topic is handled by this handler.processInstruction(Instruction instruction) Process an instruction.
-
Field Details
-
TOPIC_SET_CONTROL_PARAMETER
The instruction topic for setting control parameters.By convention the instruction should have a parameter whose key is the ID of the control to change and whose value is some control-specific data.
- See Also:
-
TOPIC_DEMAND_BALANCE
The instruction topic for balancing power generation to power demand.By convention the instruction should have a parameter whose key is the ID of the control that should respond to the balancing request and whose value is an integer percentage (0 - 100) of the maximum desired power generation capacity.
- Since:
- 1.1
- See Also:
-
TOPIC_SHED_LOAD
The instruction topic for a request to reduce power demand.By convention the instruction should have a parameter whose key is the ID of the control that should respond to the shed request and whose value is an integer representing the amount of power, in watts, requested to be shed. If the requested power is
0then any restriction on power should be removed, so that no limit is placed.- Since:
- 1.2
- See Also:
-
TOPIC_SET_OPERATING_STATE
The instruction topic for a request to change theDeviceOperatingStateof a device.By convention the instruction should have a parameter whose key is the ID of the control that should respond to the request and whose value is either an integer representing a
DeviceOperatingState.getCode()value or a string representing aEnum.name().- Since:
- 1.3
- See Also:
-
TOPIC_SIGNAL
The instruction topic for a request to signal a control or device.By convention the instruction should have a parameter whose key is the ID of the control that should respond to the request and whose value is a string representing the signal name. Signal names are control/device specific.
- Since:
- 1.4
- See Also:
-
TOPIC_SYSTEM_CONFIGURE
The instruction topic for applying system configuration.A
PARAM_SERVICEparameter must be provided that specifies the system service to apply the configuration to. Each service may define additional parameters that can be configured.- Since:
- 1.5
- See Also:
-
PARAM_SERVICE
An instruction parameter for a service name.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to the name of some service to be operated on.
- Since:
- 1.5
- See Also:
-
PARAM_SERVICE_ARGUMENT
An instruction parameter for a service argument.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to an argument to pass to a service to be operated on.
- Since:
- 1.5
- See Also:
-
PARAM_SERVICE_RESULT
An instruction parameter for a service result.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to the result of some service execution.
- Since:
- 1.5
- See Also:
-
PARAM_STATUS_CODE
An instruction parameter for a status code.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to a standardized enumeration such as an HTTP status code.
- Since:
- 1.5
- See Also:
-
PARAM_MESSAGE
An instruction parameter for a message.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to a brief message to describe a service result, such as a status code description.
- Since:
- 1.5
- See Also:
-
TOPIC_CANCEL_INSTRUCTION
The instruction topic to cancel an instruction.A
PARAM_IDparameter must be provided that specifies the instruction ID to cancel. The instruction, if not already complete, will be changed to theDeclinedstate and a result message will be added.- Since:
- 2.1
- See Also:
-
PARAM_ID
An instruction parameter for an identifier.The nature of this parameter depends on the topic it is associated with. Generally it is meant to refer to a unique identifier associated with the topic.
- Since:
- 2.1
- See Also:
-
TOPIC_SYSTEM_CONFIGURATION
The instruction topic for obtaining system configuration.A
PARAM_SERVICEparameter must be provided that specifies the system service to get the configuration for. Each service may define additional parameters that can be configured.- Since:
- 2.2
- See Also:
-
-
Method Details
-
handlesTopic
Test if a topic is handled by this handler.- Parameters:
topic- the topic- Returns:
- true only if this handler can execute the job for the given topic
-
processInstruction
Process an instruction.- Parameters:
instruction- the instruction to process- Returns:
- the status for the instruction, or null if the instruction was not handled
-