public interface CollaborationBusMessageHandler
Modifier and Type | Method and Description |
---|---|
void |
registerResponseListener(String channel,
MessageReceiver msgReceiver)
Registers a callback listener for each channel that responses are to be
received on.
|
CollaborationBusMessageHeader |
sendMessage(String messageType,
String channel,
byte[] body,
String user)
Sends a message to a channel.
|
CollaborationBusMessageHeader |
sendMessage(String messageType,
String destinationChannel,
byte[] body,
String user,
PreSendMessageHandler preSendMessageHandler)
Sends a message on a channel.
|
CollaborationBusMessageHeader |
sendResponse(String messageType,
CollaborationBusMessageHeader requestHeader,
byte[] body)
Sends a response message to a previously received message.
|
CollaborationBusMessageHeader sendMessage(String messageType, String channel, byte[] body, String user) throws CollaborationBusException
channel
- The name of the channel the message will be delivered to, i.e
Emailbody
- The contents to be delivered by the Collaboration Bus.user
- The user if the message is related to a user, otherwise null.
User related messages will be routed according to the user's
service profile.messageType
- An optional parameter provided by the sender of a message.
Message types should be defined by the service. They are used
to identify the types of messages being exchanged. i.e.
new_email, email_sent, email_failed, email_queued etc.CollaborationBusException
CollaborationBusMessageHeaderImpl
CollaborationBusMessageHeader sendMessage(String messageType, String destinationChannel, byte[] body, String user, PreSendMessageHandler preSendMessageHandler) throws CollaborationBusException
destinationChannel
- The name of the channel to which the message will be
delivered. i.e Emailbody
- The contents of the message to be delivered.user
- The user if the message is related to a user, otherwise null.
User related messages will be routed according to the user's
service profile.messageType
- An optional String type parameter provided by the caller. This
could be used to indicate the message type of the message.preSendMessageHandler
- An optional PreSendMessageHandler. It is needed only when a
response to this message needs to be correlated. When
provided, the handle() method is invoked with a populated
CollaborationBusMessageHeader before the message is actually
sent. The getSequenceId() returns a unique id associated with
this request message and any responses to it. An application
may want to keep track of what requests have been responded to
and this unique id can assist with that operation. A typical
use would be to add the header to a tracking hash map e.g.
trackMap.add(requestHeader.getSequenceId(),requestHeader).
When a response message is received, the header of the request
can be checked to see which request it is a response to e.g.
requestHeader =
trackMap.get(responseHeader.getResponseToSequenceId()). This
is done as a pre-send operation to insure the request can be
stored before the asynchronous response is received.CollaborationBusException
CollaborationBusMessageHeaderImpl
CollaborationBusMessageHeader sendResponse(String messageType, CollaborationBusMessageHeader requestHeader, byte[] body) throws CollaborationBusException
messageType
- An optional message type defined by user.requestHeader
- The header from the received request that the response is for.body
- The contents of the response message.CollaborationBusException
void registerResponseListener(String channel, MessageReceiver msgReceiver) throws CollaborationBusException
channel
- The channel that the registration is for.msgReceiver
- The callback class called when a message is received.CollaborationBusException
MessageReceiver
Copyright © 2016 Avaya. All Rights Reserved.