Class AgentLink<T extends AgentLink<?>>

java.lang.Object
org.openremote.model.asset.agent.AgentLink<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DefaultAgentLink

public abstract class AgentLink<T extends AgentLink<?>> extends Object implements Serializable
Represents the configuration of an Attribute linked to an Agent; each Agent should have its' own concrete implementation of this class or use DefaultAgentLink with fields describing each configuration item and standard JSR-380 annotations should be used to provide validation logic.
See Also:
  • Field Details

    • id

      protected String id
    • valueFilters

      @JsonPropertyDescription("Defines ValueFilters to apply to an incoming value before it is written to a protocol linked attribute; this is particularly useful for generic protocols. The message should pass through the filters in array order") protected ValueFilter[] valueFilters
    • valueConverter

      @JsonPropertyDescription("Defines a value converter map to allow for basic value type conversion; the incoming value will be converted to JSON and if this string matches a key in the converter then the value of that key will be pushed through to the attribute. An example use case is an API that returns \'ACTIVE\'/\'DISABLED\' strings but you want to connect this to a Boolean attribute") protected Map<String,Object> valueConverter
    • writeValueConverter

      @JsonPropertyDescription("Similar to valueConverter but will be applied to outgoing values allowing for the opposite conversion") protected Map<String,Object> writeValueConverter
    • writeValue

      @JsonPropertyDescription("String to be used for attribute writes and can contain dynamic placeholders to allow dyanmic value and/or time injection with formatting (see documentation for details) into the string or alternatively write the string through to the protocol as is (static string)") protected String writeValue
    • messageMatchPredicate

      @JsonPropertyDescription("The predicate to apply to incoming messages to determine if the message is intended for the linked attribute; the value used in the predicate can be filtered using the message match filters. This must be defined to enable attributes to be updated by the linked agent.") protected ValuePredicate messageMatchPredicate
    • messageMatchFilters

      @JsonPropertyDescription("ValueFilters to apply to incoming messages prior to comparison with the messageMatchPredicate") protected ValueFilter[] messageMatchFilters
    • updateOnWrite

      @JsonPropertyDescription("Don\'t expect a response from the protocol just update the attribute immediately on write") protected Boolean updateOnWrite
  • Constructor Details

    • AgentLink

      protected AgentLink()
    • AgentLink

      protected AgentLink(String id)
  • Method Details

    • getOrThrowAgentLinkProperty

      public static <T> T getOrThrowAgentLinkProperty(Optional<T> value, String name)
    • getType

      protected String getType()
    • getId

      public String getId()
    • getValueFilters

      public Optional<ValueFilter[]> getValueFilters()
    • setValueFilters

      public T setValueFilters(ValueFilter[] valueFilters)
    • getValueConverter

      public Optional<Map<String,Object>> getValueConverter()
    • setValueConverter

      public T setValueConverter(Map<String,Object> valueConverter)
    • getWriteValueConverter

      public Optional<Map<String,Object>> getWriteValueConverter()
    • setWriteValueConverter

      public T setWriteValueConverter(Map<String,Object> writeValueConverter)
    • getWriteValue

      public Optional<String> getWriteValue()
    • setWriteValue

      public T setWriteValue(String writeValue)
    • getMessageMatchPredicate

      public Optional<ValuePredicate> getMessageMatchPredicate()
    • setMessageMatchPredicate

      public T setMessageMatchPredicate(ValuePredicate messageMatchPredicate)
    • getMessageMatchFilters

      public Optional<ValueFilter[]> getMessageMatchFilters()
    • setMessageMatchFilters

      public T setMessageMatchFilters(ValueFilter[] messageMatchFilters)
    • getUpdateOnWrite

      public Optional<Boolean> getUpdateOnWrite()
    • setUpdateOnWrite

      public T setUpdateOnWrite(Boolean updateOnWrite)