Class DatumStreamReactor
java.lang.Object
net.solarnetwork.service.support.BasicIdentifiable
net.solarnetwork.node.service.support.BaseIdentifiable
net.solarnetwork.node.control.datumreactor.DatumStreamReactor
- All Implemented Interfaces:
net.solarnetwork.service.Identifiable,net.solarnetwork.settings.SettingSpecifierProvider,org.osgi.service.event.EventHandler
public class DatumStreamReactor
extends net.solarnetwork.node.service.support.BaseIdentifiable
implements net.solarnetwork.settings.SettingSpecifierProvider, org.osgi.service.event.EventHandler
Service to monitor a datum stream and issue an instruction to a control with
a value resulting from evaluating an expression.
- Version:
- 1.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTheinstructionTopicproperty default value.Fields inherited from class net.solarnetwork.node.service.support.BaseIdentifiable
logFields inherited from interface net.solarnetwork.service.Identifiable
GROUP_UID_PROPERTY, UID_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the control property configuration.Get the instruction topic.net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.OperationalModesService> Get the operational modes service.List<net.solarnetwork.settings.SettingSpecifier> Get the source ID regular expression.Get the source ID regular expression as a string.voidhandleEvent(org.osgi.service.event.Event event) voidsetDatumService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.DatumService> datumService) Set the datum service.voidsetExecutor(Executor executor) Set an executor to use for internal tasks.voidsetInstructionExecutionService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.reactor.InstructionExecutionService> instructionExecutionService) Set the instruction service.voidsetInstructionTopic(String instructionTopic) Set the instruction topic.voidsetOpModesService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.OperationalModesService> opModesService) Set the operational modes service.voidsetSourceIdRegex(Pattern sourceIdRegex) Set the source ID regular expression.voidsetSourceIdRegexValue(String sourceIdRegex) Set the source ID regular expression as a string.Methods inherited from class net.solarnetwork.node.service.support.BaseIdentifiable
baseIdentifiableSettings, baseIdentifiableSettings, getExpressionServices, getPlaceholderService, populateExpressionDatumProperties, resolvePlaceholders, resolvePlaceholders, setExpressionServices, setPlaceholderServiceMethods inherited from class net.solarnetwork.service.support.BasicIdentifiable
basicIdentifiableMetadataSettings, basicIdentifiableSettings, basicIdentifiableSettings, basicIdentifiableSettings, doubleMetadataValue, getGroupUid, getGroupUID, getMessageSource, getMetadata, getMetadataCount, getUid, getUID, integerMetadataValue, metadataValue, numberMetadataValue, saveMetadataValue, saveMetadataValue, setDisplayName, setGroupUid, setGroupUID, setMessageSource, setMetadata, setMetadataCount, setUid, setUID, smartMetadataValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.service.Identifiable
getGroupUid, getUidMethods inherited from interface net.solarnetwork.settings.SettingSpecifierProvider
getMessageSource, templateSettingSpecifiers
-
Field Details
-
DEFAULT_INSTRUCTION_TOPIC
TheinstructionTopicproperty default value.- See Also:
-
-
Constructor Details
-
DatumStreamReactor
public DatumStreamReactor()
-
-
Method Details
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler
-
getSettingUid
- Specified by:
getSettingUidin interfacenet.solarnetwork.settings.SettingSpecifierProvider
-
getDisplayName
- Specified by:
getDisplayNamein interfacenet.solarnetwork.service.Identifiable- Specified by:
getDisplayNamein interfacenet.solarnetwork.settings.SettingSpecifierProvider- Overrides:
getDisplayNamein classnet.solarnetwork.service.support.BasicIdentifiable
-
getSettingSpecifiers
- Specified by:
getSettingSpecifiersin interfacenet.solarnetwork.settings.SettingSpecifierProvider
-
setExecutor
Set an executor to use for internal tasks.- Parameters:
executor- the executor
-
getSourceIdRegex
Get the source ID regular expression.- Returns:
- the source ID expression, or null for including all source IDs
-
setSourceIdRegex
Set the source ID regular expression.- Parameters:
sourceIdRegex- a pattern to match against source IDs; if defined then this datum will only be generated for controls with matching source ID values; if null then generate datum for all controls
-
getSourceIdRegexValue
Get the source ID regular expression as a string.- Returns:
- the source ID expression string, or null for including all source IDs
-
setSourceIdRegexValue
Set the source ID regular expression as a string.Errors compiling
sourceIdRegexinto aPatternwill be silently ignored, causing the regular expression to be set to null.- Parameters:
sourceIdRegex- a pattern to match against source IDs; if defined then this datum will only be generated for controls with matching source ID values; if null then generate datum for all controls
-
getConfig
Get the control property configuration.- Returns:
- the configuration, never null
-
setInstructionExecutionService
public void setInstructionExecutionService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.reactor.InstructionExecutionService> instructionExecutionService) Set the instruction service.- Parameters:
instructionExecutionService- the service to set
-
setDatumService
public void setDatumService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.DatumService> datumService) Set the datum service.- Parameters:
datumService- the service to set
-
getInstructionTopic
Get the instruction topic.- Returns:
- the instruction topic, never null
-
setInstructionTopic
Set the instruction topic.- Parameters:
instructionTopic- the instruction topic to set; if null thenDEFAULT_INSTRUCTION_TOPICwill be set instead
-
getOpModesService
public net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.OperationalModesService> getOpModesService()Get the operational modes service.- Returns:
- the service
-
setOpModesService
public void setOpModesService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.OperationalModesService> opModesService) Set the operational modes service.- Parameters:
opModesService- the service to set
-