- Add a new value to the
PlotJugglerConnectionTypeenum. - Create a
XxxConnectionConfigurationclass implementingPlotJugglerConnectionConfiguration(its only required method isgetType(), returning the new enum value). Follow the existingMqttConnectionConfiguration/UdpConnectionConfiguration/WebSocketConnectionConfigurationpattern: a no-arg constructor (for YAML), a convenience constructor, plain getters/setters, and a staticfromYaml(String)delegating toYamlConfigLoader. - Create a
XxxPlotJugglerConnectionclass implementingPlotJugglerConnection(connect()/disconnect()/isConnected()/send(String channel, byte[] payload)). - Wire the new pair into the
switchinPlotJugglerConnectionFactory.create(...).
If the transport needs to know the configured wire format to behave correctly (as WebSocket does, to pick
TEXT vs BINARY frames), accept a PlotJugglerMessageFormat parameter in the connection's constructor - it
is already threaded through PlotJugglerConnectionFactory.create(configuration, messageFormat) and
PlotJugglerConnectionManager, so no further plumbing is needed; other transports simply ignore it.
- Add a new value to the
PlotJugglerMessageFormatenum. - Create a
XxxMessageSerializerclass implementingPlotJugglerMessageSerializer(serialize(Object message, PlotJugglerChannelKind channelKind): byte[]anddeserialize(byte[] payload): Map<String, PlotJugglerOutgoingMessage>).- For a self-describing format (like JSON/CBOR/MessagePack/BSON), this is usually a ~20-line wrapper
around a Jackson
ObjectMapperconfigured with the format'sJsonFactory- seeCborMessageSerializer/BsonMessageSerializerfor the exact pattern to copy. ThechannelKindparameter can simply be ignored. - For a schema-based format (like Protobuf),
channelKind(STATE/PROPERTY/EVENT/RELATIONSHIP, fromPlotJugglerChannelKind) tells you which concept-specific shape to produce - seeProtobufMessageSerializerand the.protofiles inproto/as a full worked example, including how to ship/version a schema PlotJuggler needs to be told about separately.
- For a self-describing format (like JSON/CBOR/MessagePack/BSON), this is usually a ~20-line wrapper
around a Jackson
- Wire the new serializer into the
switchinPlotJugglerMessageFactory.getSerializer(...).
No other code needs to change: every transport already calls serializer.serialize(...) generically
through PlotJugglerDigitalAdapter.sendOnChannel(...).