Package org.fisco.bcos.sdk.amop
Class AmopImp
java.lang.Object
org.fisco.bcos.sdk.amop.AmopImp
- All Implemented Interfaces:
Amop
public class AmopImp extends java.lang.Object implements Amop
Amop implement
-
Constructor Summary
Constructors Constructor Description AmopImp(Channel channel, ConfigOption config) -
Method Summary
Modifier and Type Method Description voidbroadcastAmopMsg(AmopMsgOut content)Send amop msgjava.util.Set<java.lang.String>getAllTopics()java.util.Set<java.lang.String>getSubTopics()Get all subscribe topics.TopicManagergetTopicManager()voidpublishPrivateTopic(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.
-
Constructor Details
-
Method Details
-
subscribeTopic
Description copied from interface:AmopSubscribe a normal topic.- Specified by:
subscribeTopicin interfaceAmop- Parameters:
topicName- the topic namecallback- callback is called when receive a msg relate to this topic
-
subscribePrivateTopics
public void subscribePrivateTopics(java.lang.String topicName, KeyTool privateKeyTool, AmopCallback callback)Description copied from interface:AmopSubscribe a private topic which need verify.- Specified by:
subscribePrivateTopicsin interfaceAmop- 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
public void publishPrivateTopic(java.lang.String topicName, java.util.List<KeyTool> publicKeyTools)Description copied from interface:AmopConfig a topic which is need verification, after that user can send message to verified subscriber.- Specified by:
publishPrivateTopicin interfaceAmop- Parameters:
topicName- the topic namepublicKeyTools- the public keys of the target organizations that you want to communicate with
-
unsubscribeTopic
public void unsubscribeTopic(java.lang.String topicName)Description copied from interface:AmopUnsubscribe a topic.- Specified by:
unsubscribeTopicin interfaceAmop- Parameters:
topicName- the topic name
-
sendAmopMsg
Description copied from interface:AmopSend amop msg- Specified by:
sendAmopMsgin interfaceAmop- Parameters:
content- the sent messagecallback- the callback that will be called when receive the AMOP response
-
broadcastAmopMsg
Description copied from interface:AmopSend amop msg- Specified by:
broadcastAmopMsgin interfaceAmop- Parameters:
content- the broadcasted AMOP message
-
getSubTopics
public java.util.Set<java.lang.String> getSubTopics()Description copied from interface:AmopGet all subscribe topics.- Specified by:
getSubTopicsin interfaceAmop- Returns:
- topic name list
-
setCallback
Description copied from interface:Amopset amop default callback- Specified by:
setCallbackin interfaceAmop- Parameters:
cb- the amop callback
-
start
public void start()Description copied from interface:AmopStart. -
stop
public void stop()Description copied from interface:AmopStop. -
sendSubscribe
public void sendSubscribe()- Specified by:
sendSubscribein interfaceAmop
-
getAllTopics
public java.util.Set<java.lang.String> getAllTopics() -
getTopicManager
- Specified by:
getTopicManagerin interfaceAmop
-