接口 WeDPRTransport

所有已知实现类:
TransportImpl

public interface WeDPRTransport
  • 方法详细资料

    • start

      void start()
    • stop

      void stop()
    • registerComponent

      void registerComponent(String component) throws Exception
      register the component
      参数:
      component - the component used to router
      抛出:
      Exception - failed case
    • unRegisterComponent

      void unRegisterComponent(String component) throws Exception
      unregister the component
      参数:
      component - the component used to route
      抛出:
      Exception - failed case
    • registerTopic

      void registerTopic(String topic) throws Exception
      register the topic
      参数:
      topic - the topic used to route
      抛出:
      Exception - failed case
    • unRegisterTopic

      void unRegisterTopic(String topic) throws Exception
      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 callback
      messageDispatcherCallback - the message callback
    • asyncGetPeers

      void asyncGetPeers(GetPeersCallback handler)
      async get peers information
      参数:
      handler - the handler that handle the peersInfo
    • registerTopicHandler

      void registerTopicHandler(String topic, MessageDispatcherCallback messageHandler)
      register the message handler
      参数:
      topic - the topic
      messageHandler - 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 topic
      dstNode - the dstNode
      payload - the payload
      seq - the seq of the payload
      timeout - the timeout setting
      errorCallback - 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 topic
      agency - the agency
      payload - the payload
      seq - the seq
      timeout - the timeout
      errorCallback - 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 too
      payload - the payload(the payload)
      seq - the seq(the seq)
      timeout - the timeout
      errorCallback - 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 response
      traceID - the traceID of the response
      payload - the payload
      seq - the seq
      errorCallback - the error callback
    • removeTopic

      void removeTopic(String topic) throws WeDPRSDKException
      参数:
      topic - the topic to remove
      抛出:
      WeDPRSDKException
    • pushByNodeID

      void pushByNodeID(String topic, byte[] dstNodeID, int seq, byte[] payload, int timeout) throws WeDPRSDKException
      抛出:
      WeDPRSDKException
    • pushByComponent

      void pushByComponent(String topic, String dstInst, String component, int seq, byte[] payload, int timeout) throws WeDPRSDKException
      抛出:
      WeDPRSDKException
    • pushByInst

      void pushByInst(String topic, String dstInst, int seq, byte[] payload, int timeout) throws WeDPRSDKException
      抛出:
      WeDPRSDKException
    • pop

      IMessage pop(String topic, int timeout) throws WeDPRSDKException
      抛出:
      WeDPRSDKException
    • peek

      IMessage peek(String topic)
    • selectNodeListByPolicy

      List<String> selectNodeListByPolicy(RouteType routeType, String dstInst, String dstComponent, String dstNode)
    • getAliveEntryPoints

      List<ServiceMeta.EntryPointMeta> getAliveEntryPoints(String serviceName)
    • registerService

      void registerService(String serviceName, String entryPoint) throws Exception
      抛出:
      Exception
    • getTransportConfig

      TransportConfig getTransportConfig()