Class ArtnetProtocol
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<ArtnetProtocol,ArtnetAgent,ArtnetPacket,UDPIOClient<ArtnetPacket>,org.openremote.model.asset.agent.DefaultAgentLink>
org.openremote.agent.protocol.artnet.ArtnetProtocol
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<ArtnetAgent>,org.openremote.model.protocol.ProtocolAssetImport
public class ArtnetProtocol
extends AbstractNettyIOClientProtocol<ArtnetProtocol,ArtnetAgent,ArtnetPacket,UDPIOClient<ArtnetPacket>,org.openremote.model.asset.agent.DefaultAgentLink>
implements org.openremote.model.protocol.ProtocolAssetImport
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,ArtnetLightAsset> static final Stringprotected final Map<org.openremote.model.attribute.AttributeRef,Consumer<ArtnetPacket>> Fields inherited from class org.openremote.agent.protocol.io.AbstractIOClientProtocol
client, LOGFields 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 ArtnetPacketcreateWriteMessage(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 UDPIOClient<ArtnetPacket>Should return an instance ofIOClientfor the linkedAgent.protected 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(ArtnetPacket packet) Called when theIOClientreceives a message from the serverstartAssetImport(byte[] fileData, Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone().Methods 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
protected final Map<org.openremote.model.attribute.AttributeRef,Consumer<ArtnetPacket>> protocolMessageConsumers -
lights
-
-
Constructor Details
-
ArtnetProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet the name for this protocol- Specified by:
getProtocolNamein interfaceorg.openremote.model.asset.agent.Protocol<ArtnetAgent>
-
doCreateIoClient
Description copied from class:AbstractIOClientProtocolShould return an instance ofIOClientfor the linkedAgent.- Specified by:
doCreateIoClientin classAbstractIOClientProtocol<ArtnetProtocol,ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink> - Throws:
Exception
-
getEncoderDecoderProvider
Description copied from class:AbstractNettyIOClientProtocolGets the NettyChannelHandlers for the IO client- Specified by:
getEncoderDecoderProviderin classAbstractNettyIOClientProtocol<ArtnetProtocol,ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink>
-
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<ArtnetAgent,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<ArtnetAgent,org.openremote.model.asset.agent.DefaultAgentLink>
-
onMessageReceived
Description copied from class:AbstractIOClientProtocolCalled when theIOClientreceives a message from the server- Specified by:
onMessageReceivedin classAbstractIOClientProtocol<ArtnetProtocol,ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink>
-
createWriteMessage
protected ArtnetPacket 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<ArtnetProtocol,ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink>
-
startAssetImport
public Future<Void> startAssetImport(byte[] fileData, Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Description copied from interface:org.openremote.model.protocol.ProtocolAssetImportStart the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone(). The callee can also cancel the future at any time. If for some reason the process cannot be started or encounters an error then this method should log more details before completing the future.- Specified by:
startAssetImportin interfaceorg.openremote.model.protocol.ProtocolAssetImport
-