Class ProtocolUtil

java.lang.Object
org.openremote.model.protocol.ProtocolUtil

public final class ProtocolUtil extends Object
  • Field Details

    • LOG

      protected static Logger 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

      public static boolean hasDynamicPlaceholders(AgentLink<?> agentLink)
    • 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

      public static Pair<Boolean,Object> applyValueConverter(Object value, Map<String,Object> converter)
    • createGenericAttributeMessageConsumer

      public static Consumer<String> createGenericAttributeMessageConsumer(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Supplier<Long> currentMillisSupplier, BiConsumer<AttributeRef,Object> stateConsumer)