Package org.openremote.model.asset.agent
Class AgentLink<T extends AgentLink<?>>
java.lang.Object
org.openremote.model.asset.agent.AgentLink<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultAgentLink
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 Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected ValueFilter[]
protected ValuePredicate
protected Boolean
protected ValueFilter[]
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()
static <T> T
getOrThrowAgentLinkProperty
(Optional<T> value, String name) protected String
getType()
setMessageMatchFilters
(ValueFilter[] messageMatchFilters) setMessageMatchPredicate
(ValuePredicate messageMatchPredicate) setUpdateOnWrite
(Boolean updateOnWrite) setValueConverter
(Map<String, Object> valueConverter) setValueFilters
(ValueFilter[] valueFilters) setWriteValue
(String writeValue) setWriteValueConverter
(Map<String, Object> writeValueConverter)
-
Field Details
-
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
-
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
-
-
Method Details
-
getOrThrowAgentLinkProperty
-
getType
-
getId
-
getValueFilters
-
setValueFilters
-
getValueConverter
-
setValueConverter
-
getWriteValueConverter
-
setWriteValueConverter
-
getWriteValue
-
setWriteValue
-
getMessageMatchPredicate
-
setMessageMatchPredicate
-
getMessageMatchFilters
-
setMessageMatchFilters
-
getUpdateOnWrite
-
setUpdateOnWrite
-