Class SimulatorProtocol

java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
org.openremote.agent.protocol.simulator.SimulatorProtocol
All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<SimulatorAgent>

public class SimulatorProtocol extends AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
  • Field Details

  • Constructor Details

  • Method Details

    • getProtocolName

      public String getProtocolName()
      Description copied from interface: org.openremote.model.asset.agent.Protocol
      Get the name for this protocol
    • getProtocolInstanceUri

      public String getProtocolInstanceUri()
      Description copied from interface: org.openremote.model.asset.agent.Protocol
      Get a URI that describes this specific protocol instance
    • doStart

      protected void doStart(org.openremote.model.Container container) throws Exception
      Description copied from class: AbstractProtocol
      Start this protocol instance
      Specified by:
      doStart in class AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
      Throws:
      Exception
    • doStop

      protected void doStop(org.openremote.model.Container container) throws Exception
      Description copied from class: AbstractProtocol
      Stop this protocol instance
      Specified by:
      doStop in class AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
      Throws:
      Exception
    • doLinkAttribute

      protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink)
      Description copied from class: AbstractProtocol
      Link an Attribute to its linked Agent.
      Specified by:
      doLinkAttribute in class AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
    • doUnlinkAttribute

      protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink)
      Description copied from class: AbstractProtocol
      Unlink an Attribute from its linked Agent.
      Specified by:
      doUnlinkAttribute in class AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
    • doLinkedAttributeWrite

      protected void doLinkedAttributeWrite(SimulatorAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue)
      Description copied from class: AbstractProtocol
      An Attribute event (write) has been requested for an attribute linked to this protocol. The processedValue is the resulting value after applying standard outbound value processing (see ProtocolUtil.doOutboundValueProcessing(org.openremote.model.attribute.AttributeRef, org.openremote.model.asset.agent.AgentLink<?>, java.lang.Object, boolean, java.time.Instant)). Protocol implementations should generally use the processedValue but may also choose to use the original value for some purpose if required.
      Specified by:
      doLinkedAttributeWrite in class AbstractProtocol<SimulatorAgent,SimulatorAgentLink>
    • updateSensor

      public void updateSensor(org.openremote.model.attribute.AttributeEvent attributeEvent)
      Call this to simulate a sensor update
    • updateSensor

      public void updateSensor(org.openremote.model.attribute.AttributeRef attributeRef, Object value)
    • updateSensor

      public void updateSensor(org.openremote.model.attribute.AttributeRef attributeRef, Object value, long timestamp)
      Call this to simulate a sensor update using the specified timestamp
    • getReplayMap

      public Map<org.openremote.model.attribute.AttributeRef,ScheduledFuture<?>> getReplayMap()
    • scheduleReplay

      protected ScheduledFuture<?> scheduleReplay(org.openremote.model.attribute.AttributeRef attributeRef, org.openremote.model.simulator.SimulatorReplayDatapoint[] simulatorReplayDatapoints)