Class UDPProtocol
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<U,X>
org.openremote.agent.protocol.io.AbstractIOClientProtocol<T,U,V,W,X>
org.openremote.agent.protocol.io.AbstractNettyIOClientProtocol<T,U,W,X,V>
org.openremote.agent.protocol.udp.AbstractUDPProtocol<UDPProtocol,UDPAgent,org.openremote.model.asset.agent.DefaultAgentLink,String,UDPIOClient<String>>
org.openremote.agent.protocol.udp.UDPProtocol
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<UDPAgent>
public class UDPProtocol
extends AbstractUDPProtocol<UDPProtocol,UDPAgent,org.openremote.model.asset.agent.DefaultAgentLink,String,UDPIOClient<String>>
This is a UDP client protocol for communicating with UDP servers; it uses the
UDPIOClient to handle the
communication and all messages are processed as strings; if you require custom message type handling then
sub class the AbstractUDPProtocol).
To use this protocol create a UDPAgent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final List<org.openremote.model.util.Pair<org.openremote.model.attribute.AttributeRef,Consumer<String>>> Fields inherited from class org.openremote.agent.protocol.io.AbstractIOClientProtocol
clientFields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, producerTemplate, timerServiceFields inherited from interface org.openremote.model.asset.agent.Protocol
ACTUATOR_TOPIC, ACTUATOR_TOPIC_TARGET_PROTOCOL, DYNAMIC_TIME_PLACEHOLDER_REGEXP, DYNAMIC_VALUE_PLACEHOLDER, DYNAMIC_VALUE_PLACEHOLDER_REGEXP, SENSOR_QUEUE, SENSOR_QUEUE_SOURCE_PROTOCOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateWriteMessage(org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Generate the actual message to send to theIOClientfor thisAttributeEventprotected voiddoLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Link anAttributeto its linkedAgent.protected voiddoUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Unlink anAttributefrom its linkedAgent.protected Supplier<io.netty.channel.ChannelHandler[]>Gets the NettyChannelHandlers for the IO clientGet the name for this protocolprotected voidonMessageReceived(String message) Called when theIOClientreceives a message from the serverMethods inherited from class org.openremote.agent.protocol.udp.AbstractUDPProtocol
doCreateIoClientMethods inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClientProtocol
createIoClientMethods inherited from class org.openremote.agent.protocol.io.AbstractIOClientProtocol
doLinkedAttributeWrite, doStart, doStop, getGenericStringEncodersAndDecoders, getProtocolInstanceUri, onConnectionStatusChangedMethods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setConnectionStatus, start, stop, toString, unlinkAttribute, updateAgentAttribute, updateLinkedAttribute, updateLinkedAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openremote.model.asset.agent.Protocol
prefixLogMessage
-
Field Details
-
PROTOCOL_DISPLAY_NAME
- See Also:
-
protocolMessageConsumers
-
-
Constructor Details
-
UDPProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet the name for this protocol -
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Description copied from class:AbstractProtocolLink anAttributeto its linkedAgent.- Specified by:
doLinkAttributein classAbstractProtocol<UDPAgent,org.openremote.model.asset.agent.DefaultAgentLink>
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Description copied from class:AbstractProtocolUnlink anAttributefrom its linkedAgent.- Specified by:
doUnlinkAttributein classAbstractProtocol<UDPAgent,org.openremote.model.asset.agent.DefaultAgentLink>
-
getEncoderDecoderProvider
Description copied from class:AbstractNettyIOClientProtocolGets the NettyChannelHandlers for the IO client- Specified by:
getEncoderDecoderProviderin classAbstractNettyIOClientProtocol<UDPProtocol,UDPAgent, String, UDPIOClient<String>, org.openremote.model.asset.agent.DefaultAgentLink>
-
onMessageReceived
Description copied from class:AbstractIOClientProtocolCalled when theIOClientreceives a message from the server- Specified by:
onMessageReceivedin classAbstractIOClientProtocol<UDPProtocol,UDPAgent, String, UDPIOClient<String>, org.openremote.model.asset.agent.DefaultAgentLink>
-
createWriteMessage
protected String createWriteMessage(org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Description copied from class:AbstractIOClientProtocolGenerate the actual message to send to theIOClientfor thisAttributeEvent- Specified by:
createWriteMessagein classAbstractIOClientProtocol<UDPProtocol,UDPAgent, String, UDPIOClient<String>, org.openremote.model.asset.agent.DefaultAgentLink>
-