public interface MessageSender
Java interface is the parent interface for all the message senders that you can implement
in your client applications depending on your business requirements; it defines the necessary methods for sending
(asynchronous,
synchronous, or
client-side timeout) the HCI messages that include the operation requests for the connected SAP CC system.
If you want to implement some business services provided by the HTTP Communication Interface (HCI) technical interface of
SAP Convergent Charging, you must develop a message sender in your client application
to send HCI messages and receive the results:
Notes
You can implement asynchronous or synchronous communications between your client application and the connected SAP CC system.
In synchronous communications, you can define a client-side timeout. A CommunicationFailureException is
automatically thrown inside your client application if the connected SAP CC system does not reply to your request message
before the timeout expires.
Use the asyncSend(..) and send(..) methods to manage the communications between your client application and
the connected SAP CC system.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MessageSender.IRedirectHandler
This
Java interface enables to be aware of HTTP redirection events in your client application. |
| Modifier and Type | Method and Description |
|---|---|
void |
addRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Adds a
redirection handler to this MessageSender;
This handler is notified of redirection events. |
MessageContext |
asyncSend(MessageEnvelope env,
ClientMessageListener listener)
Sends a
HCI message and receives notification of progress
and upon termination of the message process via a dedicated listener. |
java.net.URL |
getServerUrl()
Returns the
URL of the server on which the MessageSender is connected. |
SystemStatus |
getSystemStatus(MessageOriginator ori)
Returns the current system status.
|
void |
removeRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Removes a
MessageSender.IRedirectHandler from this MessageSender;
The handler is not be notified anymore of redirection events. |
MessageEnvelope |
send(MessageEnvelope env)
Sends a
HCI message and receives its results via the HCI technical interface;
The communications are synchronous. |
MessageEnvelope |
send(MessageEnvelope env,
int timeout)
Sends a
HCI message and receives its results via the HCI technical interface;
this method is protected by a timeout, that means that, if the SAP CC system
does not answer within the timeout, a communication failure
is sent. |
MessageEnvelope send(MessageEnvelope env) throws CommunicationFailureException, BadMessageFormatException
HCI message and receives its results via the HCI technical interface;
The communications are synchronous.env - The message to sendCommunicationFailureException - if the SAP CC system cannot be reachedBadMessageFormatException - if the message received is in a bad formatMessageEnvelope send(MessageEnvelope env, int timeout) throws CommunicationFailureException, BadMessageFormatException
HCI message and receives its results via the HCI technical interface;
this method is protected by a timeout, that means that, if the SAP CC system
does not answer within the timeout, a communication failure
is sent.
Option: You can define a client-side timeout.env - The HCI message to sendtimeout - The timeout in millisecond (ms), a negative number means no timeoutCommunicationFailureException - if the SAP CC system cannot be reached or
if the timeout expiresBadMessageFormatException - if the message received is in a bad formatvoid addRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
redirection handler to this MessageSender;
This handler is notified of redirection events.redirectHandler - The redirection event handler to addMessageSender.IRedirectHandlervoid removeRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
MessageSender.IRedirectHandler from this MessageSender;
The handler is not be notified anymore of redirection events.redirectHandler - The redirection event handler to removeMessageContext asyncSend(MessageEnvelope env, ClientMessageListener listener) throws CommunicationFailureException, BadMessageFormatException
HCI message and receives notification of progress
and upon termination of the message process via a dedicated listener.env - The HCI message to sendlistener - A listener that will be notified of
progress and upon termination of
operations and messagemessage context that can be used to cancel
the message or retrieve resultsCommunicationFailureException - if the SAP CC system
cannot be reachedBadMessageFormatException - if the message is in
a bad formatSystemStatus getSystemStatus(MessageOriginator ori) throws OperationFailureException, CommunicationFailureException
ori - a valid message originator.system statusOperationFailureException - if the system status cannot be retrievedCommunicationFailureException - if the server cannot be contactedjava.net.URL getServerUrl()
URL of the server on which the MessageSender is connected.URL of the server on which the MessageSender is connected