Class StorageSimulatorProtocol
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink>
org.openremote.agent.protocol.simulator.storage.StorageSimulatorProtocol
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<StorageSimulatorAgent>
public class StorageSimulatorProtocol
extends AbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,ScheduledFuture<?>> static final Stringprotected final Map<String,ScheduledFuture<?>> Fields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, producerTemplate, timerServiceFields inherited from interface org.openremote.model.asset.agent.Protocol
ACTUATOR_TOPIC, ACTUATOR_TOPIC_TARGET_PROTOCOL, DYNAMIC_TIME_PLACEHOLDER_REGEXP, DYNAMIC_VALUE_PLACEHOLDER, DYNAMIC_VALUE_PLACEHOLDER_REGEXP, SENSOR_QUEUE, SENSOR_QUEUE_SOURCE_PROTOCOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink) Link anAttributeto its linkedAgent.protected voiddoLinkedAttributeWrite(org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) An Attribute event (write) has been requested for an attribute linked to this protocol.protected voiddoStart(org.openremote.model.Container container) Start this protocol instanceprotected voiddoStop(org.openremote.model.Container container) Stop this protocol instanceprotected voiddoUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink) Unlink anAttributefrom its linkedAgent.Get a URI that describes this specific protocol instanceGet the name for this protocolprotected voidscheduleInit(String assetId) protected ScheduledFuture<?>scheduleUpdate(String assetId) protected voidupdateStorageAsset(org.openremote.model.asset.impl.ElectricityStorageAsset storageAsset) Methods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setConnectionStatus, start, stop, toString, unlinkAttribute, updateAgentAttribute, updateLinkedAttribute, updateLinkedAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openremote.model.asset.agent.Protocol
prefixLogMessage
-
Field Details
-
PROTOCOL_DISPLAY_NAME
- See Also:
-
lastUpdateMap
-
simulationMap
-
initFutureMap
-
-
Constructor Details
-
StorageSimulatorProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet the name for this protocol -
getProtocolInstanceUri
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet a URI that describes this specific protocol instance -
doStart
Description copied from class:AbstractProtocolStart this protocol instance- Specified by:
doStartin classAbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink> - Throws:
Exception
-
doStop
Description copied from class:AbstractProtocolStop this protocol instance- Specified by:
doStopin classAbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink> - Throws:
Exception
-
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink) throws RuntimeException Description copied from class:AbstractProtocolLink anAttributeto its linkedAgent.- Specified by:
doLinkAttributein classAbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink> - Throws:
RuntimeException
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink) Description copied from class:AbstractProtocolUnlink anAttributefrom its linkedAgent.- Specified by:
doUnlinkAttributein classAbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink>
-
doLinkedAttributeWrite
protected void doLinkedAttributeWrite(org.openremote.model.attribute.Attribute<?> attribute, StorageSimulatorAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Description copied from class:AbstractProtocolAn 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(java.lang.String, org.openremote.model.attribute.Attribute<?>, org.openremote.model.asset.agent.AgentLink<?>, java.lang.Object, boolean)). Protocol implementations should generally use the processedValue but may also choose to use the original value for some purpose if required.- Specified by:
doLinkedAttributeWritein classAbstractProtocol<StorageSimulatorAgent,StorageSimulatorAgentLink>
-
updateStorageAsset
protected void updateStorageAsset(org.openremote.model.asset.impl.ElectricityStorageAsset storageAsset) -
scheduleInit
-
scheduleUpdate
-