public class InterApplicationBus extends Object
| Constructor and Description |
|---|
InterApplicationBus(DesktopConnection desktopConnection)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscribeListener(SubscriptionListener listener)
Registers a listener which is called whenever a subscription occurs.
|
void |
publish(String topic,
Object message)
Publishes a message to a topic
|
void |
publish(String topic,
Object message,
AckListener callback)
Publishes a message to a topic
|
void |
removeSubscribeListener(SubscriptionListener listener)
Removes the passed listener.
|
void |
send(String destinationUuid,
String topic,
Object message)
Sends a message to an application
|
void |
send(String destinationUuid,
String topic,
Object message,
AckListener listener)
Sends a message to an application
|
void |
subscribe(String sourceUuid,
String topic,
BusListener listener)
Subscribes to messages on the specified topic
|
void |
subscribe(String sourceUuid,
String topic,
BusListener listener,
AckListener callback)
Subscribes to messages on the specified topic
|
void |
unsubscribe(String sourceUuid,
String topic,
BusListener listener)
Unsubscribes to messages on the specified topic
|
void |
unsubscribe(String sourceUuid,
String topic,
BusListener listener,
AckListener callback)
Unsubscribes to messages on the specified topic
|
public InterApplicationBus(DesktopConnection desktopConnection)
desktopConnection - Connection object to the AppDesktoppublic void publish(String topic, Object message) throws DesktopException
topic - Topic to which the message is publishedmessage - The JSON message to publish *DesktopException - if this method fails to publish a messageDesktopExceptionpublic void publish(String topic, Object message, AckListener callback) throws DesktopException
topic - Topic to which the message is publishedmessage - The JSON message to publish *callback - AckListener for the requestDesktopException - if this method fails to publish a messageDesktopExceptionpublic void send(String destinationUuid, String topic, Object message) throws DesktopException
destinationUuid - UUID of the application from which messages are senttopic - Topic to which the message is publishedmessage - The JSON message to publishDesktopException - if this method fails to send a messageDesktopExceptionpublic void send(String destinationUuid, String topic, Object message, AckListener listener) throws DesktopException
destinationUuid - UUID of the application from which messages are senttopic - Topic to which the message is publishedmessage - The JSON message to publishlistener - AckListener for the messageDesktopException - if this method fails to send a messageDesktopExceptionpublic void subscribe(String sourceUuid, String topic, BusListener listener) throws DesktopException
sourceUuid - The UUID of the application to which to subscribe. The wildcard "*" can be used to receive messages from all applicationstopic - The topic to be subscribed tolistener - BusListener for the subscriptionDesktopException - if this method fails to subscribe to a topicBusListener,
DesktopExceptionpublic void subscribe(String sourceUuid, String topic, BusListener listener, AckListener callback) throws DesktopException
sourceUuid - The UUID of the application to which to subscribe. The wildcard "*" can be used to receive messages from all applicationstopic - The topic to be subscribed tolistener - BusListener for the subscriptioncallback - AckListener for the messageDesktopException - if this method fails to subscribe to a topicBusListener,
AckListener,
DesktopExceptionpublic void unsubscribe(String sourceUuid, String topic, BusListener listener) throws DesktopException
sourceUuid - UUID of the applicationtopic - The topic to be subscribed tolistener - BusListener for the subscriptionDesktopException - if this method fails to unsubscribe a topicBusListener,
DesktopExceptionpublic void unsubscribe(String sourceUuid, String topic, BusListener listener, AckListener callback) throws DesktopException
sourceUuid - UUID of the applicationtopic - The topic to be subscribed tolistener - BusListener for the subscriptioncallback - AckListener for the messageDesktopException - if this method fails t unsubscribe a topicBusListener,
AckListener,
DesktopExceptionpublic void addSubscribeListener(SubscriptionListener listener)
listener - Listener to addpublic void removeSubscribeListener(SubscriptionListener listener)
listener - Listener to removeCopyright © 2022. All rights reserved.