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 |
sendEventingMessage(String messageType,
String serviceName,
String serviceVersion,
byte[] body)
Sends an eventing message
|
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 payload 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
- is the name of the channel the message will be delivered to,
i.e Emailbody
- is the payload 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
- is an optional String type parameter provided by the caller.
Application could use this to indicate the message type in 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
- (optional) defined by user.requestHeader
- the header gotten from a previously received request.body
- CollaborationBusException
CollaborationBusMessageHeader sendEventingMessage(String messageType, String serviceName, String serviceVersion, byte[] body) throws CollaborationBusException
messageType
- (optional) defined by user.serviceName
- the name of the service to send message to.serviceVersion
- the name of the service version to send message to. Can be
"latest", "preferred", or an actual version number.body
- CollaborationBusException
void registerResponseListener(String channel, MessageReceiver msgReceiver) throws CollaborationBusException
channel
- msgReceiver
- CollaborationBusException
MessageReceiver
Copyright © 2014 Avaya. All Rights Reserved.