Package org.fisco.bcos.sdk.amop
Interface Amop
- All Known Implementing Classes:
AmopImp
public interface Amop
AMOP module interface.
-
Method Summary
Modifier and Type Method Description voidbroadcastAmopMsg(AmopMsgOut content)Send amop msgstatic Amopbuild(Channel channel, ConfigOption config)Create a Amop object.java.util.Set<java.lang.String>getSubTopics()Get all subscribe topics.TopicManagergetTopicManager()static java.lang.StringnewSeq()generate message sequence stringvoidpublishPrivateTopic(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.voidsendAmopMsg(AmopMsgOut content, AmopResponseCallback callback)Send amop msgvoidsendSubscribe()voidsetCallback(AmopCallback cb)set amop default callbackvoidstart()Start.voidstop()Stop.voidsubscribePrivateTopics(java.lang.String topicName, KeyTool privateKeyTool, AmopCallback callback)Subscribe a private topic which need verify.voidsubscribeTopic(java.lang.String topicName, AmopCallback callback)Subscribe a normal topic.voidunsubscribeTopic(java.lang.String topicName)Unsubscribe a topic.
-
Method Details
-
build
Create a Amop object.- Parameters:
channel- the channel to send/receive messageconfig- the config object- Returns:
- Amop instance
-
subscribeTopic
Subscribe a normal topic.- Parameters:
topicName- the topic namecallback- 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 nameprivateKeyTool- the private key you used to prove your identity.callback- callback is called when receive a msg relate to this topic
-
publishPrivateTopic
Config a topic which is need verification, after that user can send message to verified subscriber.- Parameters:
topicName- the topic namepublicKeyTools- 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
Send amop msg- Parameters:
content- the sent messagecallback- the callback that will be called when receive the AMOP response
-
broadcastAmopMsg
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
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()
-