Class TrdpSessionFactory.ConfiguredMdSession

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

public static class TrdpSessionFactory.ConfiguredMdSession extends Object implements AutoCloseable
An MD session configured from XML with an MdRequester, MdReplier, a DatasetMarshaller, and per-telegram configuration.
  • Method Details

    • start

      public void start()
      Starts the replier (begins accepting requests).
    • getRequester

      public MdRequester getRequester()
      Returns the underlying requester for advanced operations.
    • getReplier

      public MdReplier getReplier()
      Returns the underlying replier for advanced operations.
    • getMarshaller

      public DatasetMarshaller getMarshaller()
      Returns the dataset marshaller.
    • getTelegramConfigs

      public Map<Integer, TrdpSessionFactory.MdTelegramConfig> getTelegramConfigs()
      Returns per-telegram configurations, keyed by ComID.
    • sendRequest

      public CompletableFuture<MdReply> sendRequest(int comId, Map<String,Object> values, String destinationAddress, int destinationPort)
      Sends an MD request using per-telegram configuration.

      If a dataset schema exists for the given ComID, values are auto-marshalled. The per-telegram protocol, timeout, and retries from XML config are applied.

      Parameters:
      comId - the communication ID
      values - field name to value mapping (marshalled if schema exists)
      destinationAddress - the destination IP address
      destinationPort - the destination port
      Returns:
      a future that completes with the reply
    • sendRequest

      public CompletableFuture<MdReply> sendRequest(int comId, byte[] data, String destinationAddress, int destinationPort)
      Sends an MD request with raw byte payload using per-telegram configuration.
      Parameters:
      comId - the communication ID
      data - the raw payload bytes
      destinationAddress - the destination IP address
      destinationPort - the destination port
      Returns:
      a future that completes with the reply
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable