Class ArtnetProtocol
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<ArtnetAgent,org.openremote.model.asset.agent.DefaultAgentLink>
org.openremote.agent.protocol.io.AbstractIOClientProtocol<ArtnetProtocol,ArtnetAgent,ArtnetPacket,UDPIOClient<ArtnetPacket>,org.openremote.model.asset.agent.DefaultAgentLink>
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 String
protected final Map
<org.openremote.model.attribute.AttributeRef, Consumer<ArtnetPacket>> Fields inherited from class org.openremote.agent.protocol.io.AbstractIOClientProtocol
client, LOG
Fields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, processorLock, producerTemplate, scheduledExecutorService, timerService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ArtnetPacket
createWriteMessage
(org.openremote.model.asset.agent.DefaultAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Generate the actual message to send to theIOClient
for thisAttributeEvent
protected UDPIOClient
<ArtnetPacket> Should return an instance ofIOClient
for the linkedAgent
.protected void
doLinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Link anAttribute
to its linkedAgent
.protected void
doUnlinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink) Unlink anAttribute
from its linkedAgent
.protected Supplier
<io.netty.channel.ChannelHandler[]> Gets the NettyChannelHandler
s for the IO clientGet the name for this protocolprotected void
onMessageReceived
(ArtnetPacket packet) Called when theIOClient
receives 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
createIoClient
Methods inherited from class org.openremote.agent.protocol.io.AbstractIOClientProtocol
doLinkedAttributeWrite, doStart, doStop, getGenericStringEncodersAndDecoders, getProtocolInstanceUri, onConnectionStatusChanged
Methods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, onAgentAttributeChanged, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setAssetService, setConnectionStatus, start, stop, toString, unlinkAttribute, updateLinkedAttribute, updateLinkedAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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.Protocol
Get the name for this protocol- Specified by:
getProtocolName
in interfaceorg.openremote.model.asset.agent.Protocol<ArtnetAgent>
-
doCreateIoClient
Description copied from class:AbstractIOClientProtocol
Should return an instance ofIOClient
for the linkedAgent
.- Specified by:
doCreateIoClient
in classAbstractIOClientProtocol<ArtnetProtocol,
ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink> - Throws:
Exception
-
getEncoderDecoderProvider
Description copied from class:AbstractNettyIOClientProtocol
Gets the NettyChannelHandler
s for the IO client- Specified by:
getEncoderDecoderProvider
in 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:AbstractProtocol
Link anAttribute
to its linkedAgent
.- Specified by:
doLinkAttribute
in 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:AbstractProtocol
Unlink anAttribute
from its linkedAgent
.- Specified by:
doUnlinkAttribute
in classAbstractProtocol<ArtnetAgent,
org.openremote.model.asset.agent.DefaultAgentLink>
-
onMessageReceived
Description copied from class:AbstractIOClientProtocol
Called when theIOClient
receives a message from the server- Specified by:
onMessageReceived
in classAbstractIOClientProtocol<ArtnetProtocol,
ArtnetAgent, ArtnetPacket, UDPIOClient<ArtnetPacket>, org.openremote.model.asset.agent.DefaultAgentLink>
-
createWriteMessage
protected ArtnetPacket createWriteMessage(org.openremote.model.asset.agent.DefaultAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Description copied from class:AbstractIOClientProtocol
Generate the actual message to send to theIOClient
for thisAttributeEvent
- Specified by:
createWriteMessage
in 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.ProtocolAssetImport
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()
. 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:
startAssetImport
in interfaceorg.openremote.model.protocol.ProtocolAssetImport
-