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 Details

    • mailClient

      protected MailClient mailClient
    • attributeMessageProcessorMap

      protected Map<org.openremote.model.attribute.AttributeRef,Function<org.openremote.model.mail.MailMessage,String>> attributeMessageProcessorMap
    • LOG

      protected static final Logger LOG
    • INITIAL_CHECK_DELAY_SECONDS

      protected static int INITIAL_CHECK_DELAY_SECONDS
  • Constructor Details

    • AbstractMailProtocol

      public AbstractMailProtocol(T agent)
  • Method Details

    • 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<T extends AbstractMailAgent<T,U,V>,V extends org.openremote.model.asset.agent.AgentLink<V>>
      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<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 an Attribute to its linked Agent.
      Specified by:
      doLinkAttribute in class AbstractProtocol<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 an Attribute from its linked Agent.
      Specified by:
      doUnlinkAttribute in class AbstractProtocol<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 (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<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

      protected abstract Predicate<org.openremote.model.mail.MailMessage> getAttributeMailMessageFilter(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink)
    • getMailMessageAttributeValue

      protected abstract String getMailMessageAttributeValue(String assetId, org.openremote.model.attribute.Attribute<?> attribute, V agentLink, org.openremote.model.mail.MailMessage mailMessage)