Interface MessageSender
- All Known Implementing Classes:
AdminMessageSender,HttpMessageSender,com.highdeal.hci.internal.InternalAdminMessageSender,UpdaterMessageSender
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.
Implementation in Your Client Application
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:
- AdminMessageSender
- HttpMessageSender
- UpdaterMessageSender
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThisJava interfaceenables to be aware of HTTP redirection events in your client application. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRedirectHandler(MessageSender.IRedirectHandler redirectHandler) Adds aredirection handlerto thisMessageSender; This handler is notified of redirection events.asyncSend(MessageEnvelope env, ClientMessageListener listener) Sends aHCI messageand receives notification of progress and upon termination of the message process via adedicated listener.Returns theURLof the server on which the MessageSender is connected.Returns the current system status.voidremoveRedirectHandler(MessageSender.IRedirectHandler redirectHandler) Removes aMessageSender.IRedirectHandlerfrom thisMessageSender; The handler is not be notified anymore of redirection events.send(MessageEnvelope env) Sends aHCI messageand receives its results via the HCI technical interface; The communications are synchronous.send(MessageEnvelope env, int timeout) Sends aHCI messageand 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.
-
Method Details
-
send
MessageEnvelope send(MessageEnvelope env) throws CommunicationFailureException, BadMessageFormatException Sends aHCI messageand receives its results via the HCI technical interface; The communications are synchronous.- Parameters:
env- The message to send- Returns:
- The resulting message
- Throws:
CommunicationFailureException- if the SAP CC system cannot be reachedBadMessageFormatException- if the message received is in a bad format
-
send
MessageEnvelope send(MessageEnvelope env, int timeout) throws CommunicationFailureException, BadMessageFormatException Sends aHCI messageand 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.- Parameters:
env- The HCI message to sendtimeout- The timeout in millisecond (ms), a negative number means no timeout- Returns:
- The resulting message
- Throws:
CommunicationFailureException- if the SAP CC system cannot be reached or if the timeout expiresBadMessageFormatException- if the message received is in a bad format
-
addRedirectHandler
Adds aredirection handlerto thisMessageSender; This handler is notified of redirection events.- Parameters:
redirectHandler- The redirection event handler to add- See Also:
-
removeRedirectHandler
Removes aMessageSender.IRedirectHandlerfrom thisMessageSender; The handler is not be notified anymore of redirection events.- Parameters:
redirectHandler- The redirection event handler to remove
-
asyncSend
MessageContext asyncSend(MessageEnvelope env, ClientMessageListener listener) throws CommunicationFailureException, BadMessageFormatException Sends aHCI messageand receives notification of progress and upon termination of the message process via adedicated listener.- Parameters:
env- The HCI message to sendlistener- Alistenerthat will be notified of progress and upon termination of operations and message- Returns:
- A
message contextthat can be used to cancel the message or retrieve results - Throws:
CommunicationFailureException- if the SAP CC system cannot be reachedBadMessageFormatException- if the message is in a bad format
-
getSystemStatus
SystemStatus getSystemStatus(MessageOriginator ori) throws OperationFailureException, CommunicationFailureException Returns the current system status.- Parameters:
ori- a validmessage originator.- Returns:
- the current
system status - Throws:
OperationFailureException- if the system status cannot be retrievedCommunicationFailureException- if the server cannot be contacted
-
getServerUrl
URL getServerUrl()Returns theURLof the server on which the MessageSender is connected.- Returns:
- the
URLof the server on which the MessageSender is connected
-