Class AbstractMailProtocol<T extends AbstractMailAgent<T,U,V>,U extends AbstractMailProtocol<T,U,V>,V extends org.openremote.model.asset.agent.AgentLink<V>>
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<T,V>
org.openremote.agent.protocol.mail.AbstractMailProtocol<T,U,V>
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<T>
- Direct Known Subclasses:
MailProtocol
public abstract class AbstractMailProtocol<T extends AbstractMailAgent<T,U,V>,U extends AbstractMailProtocol<T,U,V>,V extends org.openremote.model.asset.agent.AgentLink<V>>
extends AbstractProtocol<T,V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<org.openremote.model.attribute.AttributeRef,
Function<org.openremote.model.mail.MailMessage, String>> protected static int
protected static final Logger
protected MailClient
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, V agentLink) Link anAttribute
to its linkedAgent
.protected void
doLinkedAttributeWrite
(V 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, V agentLink) Unlink anAttribute
from its linkedAgent
.protected abstract Predicate<org.openremote.model.mail.MailMessage>
getAttributeMailMessageFilter
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink) protected abstract String
getMailMessageAttributeValue
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink, org.openremote.model.mail.MailMessage mailMessage) protected void
onConnectionEvent
(org.openremote.model.asset.agent.ConnectionStatus status) protected void
onMailMessage
(org.openremote.model.mail.MailMessage mailMessage) Methods 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
getProtocolInstanceUri, getProtocolName, prefixLogMessage
-
Field Details
-
mailClient
-
attributeMessageProcessorMap
-
LOG
-
INITIAL_CHECK_DELAY_SECONDS
protected static int INITIAL_CHECK_DELAY_SECONDS
-
-
Constructor Details
-
AbstractMailProtocol
-
-
Method Details
-
doStart
Description copied from class:AbstractProtocol
Start this protocol instance- Specified by:
doStart
in classAbstractProtocol<T extends AbstractMailAgent<T,
U, V>, V extends org.openremote.model.asset.agent.AgentLink<V>> - Throws:
Exception
-
doStop
Description copied from class:AbstractProtocol
Stop this protocol instance- Specified by:
doStop
in classAbstractProtocol<T extends AbstractMailAgent<T,
U, V>, V extends org.openremote.model.asset.agent.AgentLink<V>> - Throws:
Exception
-
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink) throws RuntimeException Description copied from class:AbstractProtocol
Link anAttribute
to its linkedAgent
.- Specified by:
doLinkAttribute
in classAbstractProtocol<T extends AbstractMailAgent<T,
U, V>, V extends org.openremote.model.asset.agent.AgentLink<V>> - Throws:
RuntimeException
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink) Description copied from class:AbstractProtocol
Unlink anAttribute
from its linkedAgent
.- Specified by:
doUnlinkAttribute
in classAbstractProtocol<T extends AbstractMailAgent<T,
U, V>, V extends org.openremote.model.asset.agent.AgentLink<V>>
-
doLinkedAttributeWrite
protected void doLinkedAttributeWrite(V 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<T extends AbstractMailAgent<T,
U, V>, V extends org.openremote.model.asset.agent.AgentLink<V>>
-
onConnectionEvent
protected void onConnectionEvent(org.openremote.model.asset.agent.ConnectionStatus status) -
onMailMessage
protected void onMailMessage(org.openremote.model.mail.MailMessage mailMessage) -
getAttributeMailMessageFilter
-
getMailMessageAttributeValue
-