接口 WeDPRTransport
- 所有已知实现类:
TransportImpl
public interface WeDPRTransport
-
方法概要
修饰符和类型方法说明voidasyncGetPeers(GetPeersCallback handler) async get peers informationvoidasyncSendMessageByAgency(String topic, String agency, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) send message by the agencyvoidasyncSendMessageByComponent(String topic, String dstInst, String component, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) voidasyncSendMessageByNodeID(String topic, byte[] dstNode, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) async send message by the nodeIDvoidasyncSendMessageByTopic(String topic, String dstInst, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) send message by the topic(will register firstly)voidasyncSendResponse(byte[] dstNode, String traceID, byte[] payload, int seq, MessageErrorCallback errorCallback) send response to given nodegetAliveEntryPoints(String serviceName) voidpushByComponent(String topic, String dstInst, String component, int seq, byte[] payload, int timeout) voidpushByInst(String topic, String dstInst, int seq, byte[] payload, int timeout) voidpushByNodeID(String topic, byte[] dstNodeID, int seq, byte[] payload, int timeout) voidregisterComponent(String component) register the componentvoidregisterComponentHandler(String component, MessageDispatcherCallback messageDispatcherCallback) register handlers according to componentvoidregisterService(String serviceName, String entryPoint) voidregisterTopic(String topic) register the topicvoidregisterTopicHandler(String topic, MessageDispatcherCallback messageHandler) register the message handlervoidremoveTopic(String topic) selectNodeListByPolicy(RouteType routeType, String dstInst, String dstComponent, String dstNode) voidstart()voidstop()voidunRegisterComponent(String component) unregister the componentvoidunRegisterTopic(String topic) unRegister the topic
-
方法详细资料
-
start
void start() -
stop
void stop() -
registerComponent
register the component- 参数:
component- the component used to router- 抛出:
Exception- failed case
-
unRegisterComponent
unregister the component- 参数:
component- the component used to route- 抛出:
Exception- failed case
-
registerTopic
register the topic- 参数:
topic- the topic used to route- 抛出:
Exception- failed case
-
unRegisterTopic
unRegister the topic- 参数:
topic- the topic used to route- 抛出:
Exception- failed case
-
registerComponentHandler
void registerComponentHandler(String component, MessageDispatcherCallback messageDispatcherCallback) register handlers according to component- 参数:
component- the component of the message should handled by the given callbackmessageDispatcherCallback- the message callback
-
asyncGetPeers
async get peers information- 参数:
handler- the handler that handle the peersInfo
-
registerTopicHandler
register the message handler- 参数:
topic- the topicmessageHandler- the message handler
-
asyncSendMessageByNodeID
void asyncSendMessageByNodeID(String topic, byte[] dstNode, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) async send message by the nodeID- 参数:
topic- the topicdstNode- the dstNodepayload- the payloadseq- the seq of the payloadtimeout- the timeout settingerrorCallback- the handler called after receive the message related to the topic
-
asyncSendMessageByAgency
void asyncSendMessageByAgency(String topic, String agency, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) send message by the agency- 参数:
topic- the topicagency- the agencypayload- the payloadseq- the seqtimeout- the timeouterrorCallback- the handler called after receive the message related to the topic
-
asyncSendMessageByComponent
void asyncSendMessageByComponent(String topic, String dstInst, String component, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) -
asyncSendMessageByTopic
void asyncSendMessageByTopic(String topic, String dstInst, byte[] payload, int seq, int timeout, MessageErrorCallback errorCallback, MessageCallback msgCallback) send message by the topic(will register firstly)- 参数:
topic- the topic(used to route toopayload- the payload(the payload)seq- the seq(the seq)timeout- the timeouterrorCallback- the handler
-
asyncSendResponse
void asyncSendResponse(byte[] dstNode, String traceID, byte[] payload, int seq, MessageErrorCallback errorCallback) send response to given node- 参数:
dstNode- the node that should receive the responsetraceID- the traceID of the responsepayload- the payloadseq- the seqerrorCallback- the error callback
-
removeTopic
- 参数:
topic- the topic to remove- 抛出:
WeDPRSDKException
-
pushByNodeID
void pushByNodeID(String topic, byte[] dstNodeID, int seq, byte[] payload, int timeout) throws WeDPRSDKException -
pushByComponent
void pushByComponent(String topic, String dstInst, String component, int seq, byte[] payload, int timeout) throws WeDPRSDKException -
pushByInst
void pushByInst(String topic, String dstInst, int seq, byte[] payload, int timeout) throws WeDPRSDKException -
pop
-
peek
-
selectNodeListByPolicy
-
getAliveEntryPoints
-
registerService
- 抛出:
Exception
-
getTransportConfig
TransportConfig getTransportConfig()
-