Package org.openremote.model.protocol
Class ProtocolUtil
java.lang.Object
org.openremote.model.protocol.ProtocolUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyValueConverter
(Object value, Map<String, Object> converter) createGenericAttributeMessageConsumer
(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Supplier<Long> currentMillisSupplier, BiConsumer<AttributeRef, Object> stateConsumer) doInboundValueProcessing
(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Object value) Will perform standard value processing for inbound values (Protocol -> Linked Attribute); returning the processed value and a flag indicating whether the inbound value should be ignored (i.e.doOutboundValueProcessing
(AttributeRef attributeRef, AgentLink<?> agentLink, Object value, boolean containsDynamicPlaceholder, Instant instant) Will perform standard value processing for outbound values (Linked Attribute -> Protocol); the containsDynamicPlaceholder flag is required so that the entire write value string is not searched on every single write request (for performance reasons), instead this should be recorded when the attribute is first linked.static boolean
hasDynamicPlaceholders
(AgentLink<?> agentLink)
-
Field Details
-
LOG
-
-
Constructor Details
-
ProtocolUtil
protected ProtocolUtil()
-
-
Method Details
-
doOutboundValueProcessing
public static Pair<Boolean,Object> doOutboundValueProcessing(AttributeRef attributeRef, AgentLink<?> agentLink, Object value, boolean containsDynamicPlaceholder, Instant instant) Will perform standard value processing for outbound values (Linked Attribute -> Protocol); the containsDynamicPlaceholder flag is required so that the entire write value string is not searched on every single write request (for performance reasons), instead this should be recorded when the attribute is first linked. -
hasDynamicPlaceholders
-
doInboundValueProcessing
public static Pair<Boolean,Object> doInboundValueProcessing(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Object value) Will perform standard value processing for inbound values (Protocol -> Linked Attribute); returning the processed value and a flag indicating whether the inbound value should be ignored (i.e. drop the inbound message). -
applyValueConverter
-
createGenericAttributeMessageConsumer
public static Consumer<String> createGenericAttributeMessageConsumer(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Supplier<Long> currentMillisSupplier, BiConsumer<AttributeRef, Object> stateConsumer)
-