Class TrdpSessionFactory.ConfiguredPdSession

java.lang.Object
com.trdp.config.TrdpSessionFactory.ConfiguredPdSession
All Implemented Interfaces:
AutoCloseable
Enclosing class:
TrdpSessionFactory

public static class TrdpSessionFactory.ConfiguredPdSession extends Object implements AutoCloseable
A PD session configured from XML with registered publishers, subscribers, and a DatasetMarshaller for automatic payload encoding/decoding.
  • 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 publisher
      data - the raw byte payload
      Throws:
      IllegalArgumentException - if no publisher is registered for the ComID
    • putData

      public void putData(int comId, Map<String,Object> values)
      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 publisher
      values - field name to value mapping
      Throws:
      IllegalArgumentException - if no publisher or dataset is registered for the ComID
    • getMarshaller

      public DatasetMarshaller getMarshaller()
      Returns the dataset marshaller for manual encode/decode operations.
    • getSession

      public TrdpPdSession getSession()
      Returns the underlying session for advanced operations.
    • getPublishers

      public Map<Integer, PdPublisherHandle> getPublishers()
      Returns all registered publishers, keyed by ComID.
    • getSubscribers

      public Map<Integer, PdSubscriberHandle> getSubscribers()
      Returns all registered subscribers, keyed by ComID.
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception