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>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected final Map<org.openremote.model.attribute.AttributeRef,
ScheduledFuture<?>> Fields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, processorLock, producerTemplate, scheduledExecutorService, timerService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doLinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink) Link anAttribute
to its linkedAgent
.protected void
doLinkedAttributeWrite
(SimulatorAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) An Attribute event (write) has been requested for an attribute linked to this protocol.protected void
doStart
(org.openremote.model.Container container) Start this protocol instanceprotected void
doStop
(org.openremote.model.Container container) Stop this protocol instanceprotected void
doUnlinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink) Unlink anAttribute
from its linkedAgent
.Get a URI that describes this specific protocol instanceGet the name for this protocolMap<org.openremote.model.attribute.AttributeRef,
ScheduledFuture<?>> protected ScheduledFuture<?>
scheduleReplay
(org.openremote.model.attribute.AttributeRef attributeRef, org.openremote.model.simulator.SimulatorReplayDatapoint[] simulatorReplayDatapoints) void
updateSensor
(org.openremote.model.attribute.AttributeEvent attributeEvent) Call this to simulate a sensor updatevoid
updateSensor
(org.openremote.model.attribute.AttributeRef attributeRef, Object value) void
updateSensor
(org.openremote.model.attribute.AttributeRef attributeRef, Object value, long timestamp) Call this to simulate a sensor update using the specified timestampMethods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, onAgentAttributeChanged, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setAssetService, setConnectionStatus, start, stop, toString, unlinkAttribute, updateLinkedAttribute, updateLinkedAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openremote.model.asset.agent.Protocol
prefixLogMessage
-
Field Details
-
PROTOCOL_DISPLAY_NAME
- See Also:
-
replayMap
-
-
Constructor Details
-
SimulatorProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.Protocol
Get the name for this protocol -
getProtocolInstanceUri
Description copied from interface:org.openremote.model.asset.agent.Protocol
Get a URI that describes this specific protocol instance -
doStart
Description copied from class:AbstractProtocol
Start this protocol instance- Specified by:
doStart
in classAbstractProtocol<SimulatorAgent,
SimulatorAgentLink> - Throws:
Exception
-
doStop
Description copied from class:AbstractProtocol
Stop this protocol instance- Specified by:
doStop
in classAbstractProtocol<SimulatorAgent,
SimulatorAgentLink> - Throws:
Exception
-
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink) Description copied from class:AbstractProtocol
Link anAttribute
to its linkedAgent
.- Specified by:
doLinkAttribute
in classAbstractProtocol<SimulatorAgent,
SimulatorAgentLink>
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, SimulatorAgentLink agentLink) Description copied from class:AbstractProtocol
Unlink anAttribute
from its linkedAgent
.- Specified by:
doUnlinkAttribute
in classAbstractProtocol<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 (seeProtocolUtil.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 classAbstractProtocol<SimulatorAgent,
SimulatorAgentLink>
-
updateSensor
public void updateSensor(org.openremote.model.attribute.AttributeEvent attributeEvent) Call this to simulate a sensor update -
updateSensor
-
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
-
scheduleReplay
protected ScheduledFuture<?> scheduleReplay(org.openremote.model.attribute.AttributeRef attributeRef, org.openremote.model.simulator.SimulatorReplayDatapoint[] simulatorReplayDatapoints)
-