Class TrdpSessionFactory.ConfiguredMdSession
java.lang.Object
com.trdp.config.TrdpSessionFactory.ConfiguredMdSession
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
TrdpSessionFactory
An MD session configured from XML with an
MdRequester, MdReplier,
a DatasetMarshaller, and per-telegram configuration.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the dataset marshaller.Returns the underlying replier for advanced operations.Returns the underlying requester for advanced operations.Returns per-telegram configurations, keyed by ComID.sendRequest(int comId, byte[] data, String destinationAddress, int destinationPort) Sends an MD request with raw byte payload using per-telegram configuration.sendRequest(int comId, Map<String, Object> values, String destinationAddress, int destinationPort) Sends an MD request using per-telegram configuration.voidstart()Starts the replier (begins accepting requests).
-
Method Details
-
start
public void start()Starts the replier (begins accepting requests). -
getRequester
Returns the underlying requester for advanced operations. -
getReplier
Returns the underlying replier for advanced operations. -
getMarshaller
Returns the dataset marshaller. -
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 IDvalues- field name to value mapping (marshalled if schema exists)destinationAddress- the destination IP addressdestinationPort- 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 IDdata- the raw payload bytesdestinationAddress- the destination IP addressdestinationPort- the destination port- Returns:
- a future that completes with the reply
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-