The Handlers give possibility to Automation module to execute the rules in common generic way. They provide the specific logic needed for processing a concrete instruction. They have been registered as OSGi services so the Automation Admin can trace them and provide them to the rules. They can be used for more than one instruction but some of them are factories. The Handler Factories are also registered as services in OSGi framework but they are used to create a handler per trigger instruction.
All handlers, the singletons and the factories, provide the metadata for:
returning the unique identifier of the handler, that supports a concrete type of instructions, via the getUID() method
returning the handler accurate, human-readable name via getName() method
returning the instance type via getType() method
returning the handler description via getDescription() method
returning the metadata descriptions of the handler defined inputs that could be used in Instruction instances via getInputs() method
returning the metadata descriptions of the handler defined outputs that could be used in Instruction instances via getOutputs() method
returning the assigned to the handler tags via getTags() method
The factories can also be used for:
Getting a Trigger Handler instance per trigger instruction by using method getHandler(Map<String, Object> inputValues, TriggerHandlerCallback callback)
Registering Bundles
The Automation module bundles register handlers as follows:
Automation Handler Core Bundle
The Automation module provides several handlers registered as service components by the Automation Handler Core bundle – com.prosyst.mbs.automation.handler.core:
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.ItemGetProperty"
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.ItemSetProperty"
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.ItemInvokeOperation"
com.prosyst.mbs.services.automation.handler.ConditionHandler service with UID "condition.Comparator"
com.prosyst.mbs.services.automation.handler.ConditionHandler service with UID "condition.RepeatingTime"
com.prosyst.mbs.services.automation.handler.ConditionHandler service with UID "condition.SunPosition"
com.prosyst.mbs.services.automation.handler.TriggerHandlerFactory service with UID "trigger.ItemPropertyChanged"
com.prosyst.mbs.services.automation.handler.TriggerHandlerFactory service with UID "trigger.ItemOperationExecuted"
com.prosyst.mbs.services.automation.handler.TriggerHandlerFactory service with UID "trigger.Event"
com.prosyst.mbs.services.automation.handler.TriggerHandlerFactory service with UID "trigger.RepeatingTime"
com.prosyst.mbs.services.automation.handler.TriggerHandlerFactory service with UID "trigger.SunPosition"
Dependencies:
TriggerHandlerFactory service with UID "trigger.Event" depends on org.osgi.service.event.EventAdmin service
All Time Handlers and Factories depend on com.prosyst.util.timer.Timer service
All Item Handlers and Factories depend on com.prosyst.mbs.services.fim.spi.FunctionalItemAdminSpi service
Automation Handler History Bundle
The Automation Handler History bundle – com.prosyst.mbs.automation.handler.history, registers ActionHandler service as follows:
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.HistoryAddEntry"
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.HistoryRemoveEntry"
Dependencies:
The History Handlers' depend on com.prosyst.mbs.services.history.HistoryAdmin service.
Automation Handler Script Bundle
The Automation Handler Script bundle – com.prosyst.mbs.automation.handler.script, registers:
com.prosyst.mbs.services.automation.handler.ActionHandler service with UID "action.Script"
com.prosyst.mbs.services.automation.handler.ConditionHandler service with UID "condition.Script"
Dependencies:
The Script Handlers depend on com.prosyst.mbs.services.scripting.OSGiScriptEngineManager service.