Class TrdpSessionFactory.ConfiguredPdSession
java.lang.Object
com.trdp.config.TrdpSessionFactory.ConfiguredPdSession
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
TrdpSessionFactory
A PD session configured from XML with registered publishers, subscribers,
and a
DatasetMarshaller for automatic payload encoding/decoding.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the dataset marshaller for manual encode/decode operations.Returns all registered publishers, keyed by ComID.Returns the underlying session for advanced operations.Returns all registered subscribers, keyed by ComID.voidputData(int comId, byte[] data) Stages raw byte data for the given ComID publisher.voidMarshalls field values into a binary payload and stages it for the given ComID publisher.voidstart()Starts the session (receive thread and cyclic send scheduler).
-
Method Details
-
start
public void start()Starts the session (receive thread and cyclic send scheduler). -
putData
public void putData(int comId, byte[] data) Stages raw byte data for the given ComID publisher.- Parameters:
comId- the communication ID of the publisherdata- the raw byte payload- Throws:
IllegalArgumentException- if no publisher is registered for the ComID
-
putData
Marshalls field values into a binary payload and stages it for the given ComID publisher. Fields are encoded in dataset schema order; missing fields default to zero.- Parameters:
comId- the communication ID of the publishervalues- field name to value mapping- Throws:
IllegalArgumentException- if no publisher or dataset is registered for the ComID
-
getMarshaller
Returns the dataset marshaller for manual encode/decode operations. -
getSession
Returns the underlying session for advanced operations. -
getPublishers
Returns all registered publishers, keyed by ComID. -
getSubscribers
Returns all registered subscribers, keyed by ComID. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-