Interface Amop

All Known Implementing Classes:
AmopImp

public interface Amop
AMOP module interface.
  • Method Details

    • build

      static Amop build​(Channel channel, ConfigOption config)
      Create a Amop object.
      Parameters:
      channel - the channel to send/receive message
      config - the config object
      Returns:
      Amop instance
    • subscribeTopic

      void subscribeTopic​(java.lang.String topicName, AmopCallback callback)
      Subscribe a normal topic.
      Parameters:
      topicName - the topic name
      callback - callback is called when receive a msg relate to this topic
    • subscribePrivateTopics

      void subscribePrivateTopics​(java.lang.String topicName, KeyTool privateKeyTool, AmopCallback callback)
      Subscribe a private topic which need verify.
      Parameters:
      topicName - the topic name
      privateKeyTool - the private key you used to prove your identity.
      callback - callback is called when receive a msg relate to this topic
    • publishPrivateTopic

      void publishPrivateTopic​(java.lang.String topicName, java.util.List<KeyTool> publicKeyTools)
      Config a topic which is need verification, after that user can send message to verified subscriber.
      Parameters:
      topicName - the topic name
      publicKeyTools - the public keys of the target organizations that you want to communicate with
    • unsubscribeTopic

      void unsubscribeTopic​(java.lang.String topicName)
      Unsubscribe a topic.
      Parameters:
      topicName - the topic name
    • sendAmopMsg

      void sendAmopMsg​(AmopMsgOut content, AmopResponseCallback callback)
      Send amop msg
      Parameters:
      content - the sent message
      callback - the callback that will be called when receive the AMOP response
    • broadcastAmopMsg

      void broadcastAmopMsg​(AmopMsgOut content)
      Send amop msg
      Parameters:
      content - the broadcasted AMOP message
    • getSubTopics

      java.util.Set<java.lang.String> getSubTopics()
      Get all subscribe topics.
      Returns:
      topic name list
    • setCallback

      void setCallback​(AmopCallback cb)
      set amop default callback
      Parameters:
      cb - the amop callback
    • start

      void start()
      Start.
    • stop

      void stop()
      Stop.
    • newSeq

      static java.lang.String newSeq()
      generate message sequence string
      Returns:
      Sequence string
    • getTopicManager

      TopicManager getTopicManager()
    • sendSubscribe

      void sendSubscribe()