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.1
Author:
matt
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The instructionTopic property default value.

    Fields inherited from class net.solarnetwork.node.service.support.BaseIdentifiable

    log

    Fields inherited from interface net.solarnetwork.service.Identifiable

    GROUP_UID_PROPERTY, UID_PROPERTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get 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.
    void
    handleEvent(org.osgi.service.event.Event event)
     
    void
    setDatumService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.DatumService> datumService)
    Set the datum service.
    void
    Set an executor to use for internal tasks.
    void
    setInstructionExecutionService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.reactor.InstructionExecutionService> instructionExecutionService)
    Set the instruction service.
    void
    setInstructionTopic(String instructionTopic)
    Set the instruction topic.
    void
    setOpModesService(net.solarnetwork.service.OptionalService<net.solarnetwork.node.service.OperationalModesService> opModesService)
    Set the operational modes service.
    void
    setSourceIdRegex(Pattern sourceIdRegex)
    Set the source ID regular expression.
    void
    Set the source ID regular expression as a string.

    Methods inherited from class net.solarnetwork.node.service.support.BaseIdentifiable

    baseIdentifiableSettings, baseIdentifiableSettings, getExpressionServices, getLocalStateDao, getLocationService, getMetadataService, getPlaceholderService, populateExpressionDatumProperties, resolvePlaceholders, resolvePlaceholders, setExpressionServices, setLocalStateDao, setLocationService, setMetadataService, setPlaceholderService

    Methods 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, smartMetadataValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.solarnetwork.service.Identifiable

    getGroupUid, getUid

    Methods inherited from interface net.solarnetwork.settings.SettingSpecifierProvider

    getMessageSource, localizedInfo, templateSettingSpecifiers, unwrap
  • Field Details

    • DEFAULT_INSTRUCTION_TOPIC

      public static final String DEFAULT_INSTRUCTION_TOPIC
      The instructionTopic property default value.
      See Also:
  • Constructor Details

    • DatumStreamReactor

      public DatumStreamReactor()
      Constructor.
  • Method Details

    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • getSettingUid

      public String getSettingUid()
      Specified by:
      getSettingUid in interface net.solarnetwork.settings.SettingSpecifierProvider
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface net.solarnetwork.service.Identifiable
      Specified by:
      getDisplayName in interface net.solarnetwork.settings.SettingSpecifierProvider
      Overrides:
      getDisplayName in class net.solarnetwork.service.support.BasicIdentifiable
    • getSettingSpecifiers

      public List<net.solarnetwork.settings.SettingSpecifier> getSettingSpecifiers()
      Specified by:
      getSettingSpecifiers in interface net.solarnetwork.settings.SettingSpecifierProvider
    • setExecutor

      public void setExecutor(Executor executor)
      Set an executor to use for internal tasks.
      Parameters:
      executor - the executor
    • getSourceIdRegex

      public Pattern getSourceIdRegex()
      Get the source ID regular expression.
      Returns:
      the source ID expression, or null for including all source IDs
    • setSourceIdRegex

      public void setSourceIdRegex(Pattern sourceIdRegex)
      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

      public String getSourceIdRegexValue()
      Get the source ID regular expression as a string.
      Returns:
      the source ID expression string, or null for including all source IDs
    • setSourceIdRegexValue

      public void setSourceIdRegexValue(String sourceIdRegex)
      Set the source ID regular expression as a string.

      Errors compiling sourceIdRegex into a Pattern will 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

      public ControlPropertyConfig 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

      public String getInstructionTopic()
      Get the instruction topic.
      Returns:
      the instruction topic, never null
    • setInstructionTopic

      public void setInstructionTopic(String instructionTopic)
      Set the instruction topic.
      Parameters:
      instructionTopic - the instruction topic to set; if null then DEFAULT_INSTRUCTION_TOPIC will 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