public class CDRServiceClient
extends java.lang.Object
implements com.highdeal.barbus.ISSLContextProvider
Java class provides the necessary operations to implement Offline Acquisition Services to develop an offline mediation application or connector
to be able to send Consumption Detail Records (CDRs) to the SAP CC BART Server system for being charged by SAP Convergent Charging;
This class enables synchronous communications via the Message TCP high-speed technical interface.
To develop a mediation connector you must implement in your client application:
Consumption Detail Records (CDRs) that specify the data format
handled by SAP CC BART Server. This format is based on Call Detail Record format from the telecommunication industry to facilitate this data conversion.
To manage your network traffic, this client can be bound to one or all the network interface(s) of the machine hosting your application.
If you want to force this client to be bound to one specific network interface, you must specify the argument bindAddress
with a valid IP address or a valid host name. Otherwise this client will be bound to all the network interfaces.
Whatever the bind address, the port of this client will be choosen automatically between all the available ports of the network interface(s).
Note
Consult the SAP CC Configuration Guide for more information about the communication settings and access points available in your landscape.
You specify the maximal duration (in seconds), the response of a message has to be expected whatever the sent message.
If no client timeout is needed, set timeout to .
NO_TIMEOUT
This MessageClient will maintain the connection with the server opened. If the connection is closed because of
network problem, this client will try to open again the connection with the server every 2 seconds.
| Constructor and Description |
|---|
CDRServiceClient()
Creates a non-initialized
MessageClient;
One of the methods connect() must then be used to connect it to the distant SAP CC BART Server system. |
CDRServiceClient(java.lang.String hostName,
int port)
Creates a
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API). |
CDRServiceClient(java.lang.String hostName,
int port,
int timeout)
Creates a
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API);. |
CDRServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout)
Initializes a
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API). |
| Modifier and Type | Method and Description |
|---|---|
AcquireCDRResult |
acquireCDR(java.util.Vector<CDRModel> cdrs,
AcquisitionSessionModel session)
Asks the distant SAP CC BART Server system to acquire the specified
CDRs in batch mode via the TCP Message interface;
Before to process the acquisition, you must define and start an acquisition session. |
void |
close()
Closes the connection with the CDR Service server.
|
void |
connect(java.lang.String hostName,
int port)
Connects this
MessageClient using the round robin
with the distant SAP CC BART Server system. |
void |
connect(java.lang.String hostName,
int port,
int timeout)
Connects this
MessageClient using the round robin
with the distant SAP CC BART Server system with communication timeout set in client application side. |
void |
connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout)
Connects this
MessageClient using the round robin
with the server. |
void |
connect(java.lang.String hostname,
int port,
java.lang.String bindAddress,
int timeout,
com.highdeal.cnd.message.ServiceClientTuning config)
Connects this CDRServiceClient to the distant SAP CC BART Server system.
|
javax.net.ssl.SSLContext |
getSslContext()
Returns the SSL context used with secure connections
|
int |
getTimeout()
Returns the timeout in milliseconds for each request (or -1 to wait indefinitely)
|
boolean |
isConnected()
Gets the connected status.
|
boolean |
isSecureMode()
Returns true if this client use the secure mode
|
void |
setSecureMode(boolean secureMode)
Configures the secure mode for this client application
|
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets the SSL context used with secure connections or
null to use plain connections which is the default mode. |
AcquisitionSessionModel |
startAcquisitionSession(AcquisitionSessionModel session)
Starts an
acquisition session of CDRs in the distant SAP CC system. |
AcquisitionSessionModel |
stopAcquisitionSession(AcquisitionSessionModel session,
boolean withErrors)
Stops an started
acquisition session |
public CDRServiceClient()
MessageClient;
One of the methods connect() must then be used to connect it to the distant SAP CC BART Server system.public CDRServiceClient(java.lang.String hostName,
int port)
throws java.io.IOException
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API).hostName - The host name of the distant SAP CC BART Server systemport - The communication port on which the server waits for operation requests from client applicationsjava.io.IOException - if the client cannot connect to the server (if server is not running, for instance).public CDRServiceClient(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API);.hostName - The host name of the distant SAP CC BART Server systemport - The communication port on which the server waits for operation requests from client applicationstimeout - The timeout in milliseconds for each request (or -1 to wait indefinitely).
If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).public CDRServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout)
throws java.io.IOException
MessageClient and connects it with the distant SAP CC BART Server system (server side of this API).hostName - The host name of the distant SAP CC BART Server systemport - The communication port on which the server waits for operation requests from client applicationstbindAddress - The address to bind to (can be null)timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely)
If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.java.io.IOException - if the client cannot connect to the servers.public javax.net.ssl.SSLContext getSslContext()
getSslContext in interface com.highdeal.barbus.ISSLContextProviderpublic void setSslContext(javax.net.ssl.SSLContext sslContext)
null to use plain connections which is the default mode.sslContext - The SSL context used with secure connectionspublic boolean isSecureMode()
public void setSecureMode(boolean secureMode)
throws java.security.NoSuchAlgorithmException
secureMode - The secure mode to use for this client; If true, this method sets the SSL context to its default value.java.security.NoSuchAlgorithmException - When the secure mode SSL context cannot be createdsetSslContext(SSLContext)public int getTimeout()
-1 if no timeout has previously been set for this MessageClient.public AcquireCDRResult acquireCDR(java.util.Vector<CDRModel> cdrs, AcquisitionSessionModel session) throws InvalidCDRException, InvalidAcquisitionException, com.highdeal.hci.ServerFailureException, com.highdeal.cnd.message.CommunicationFailureException
CDRs in batch mode via the TCP Message interface;
Before to process the acquisition, you must define and start an acquisition session.cdrs - A vector of CDRs to be acquired by BART Serversession - The acquisition session which these CDRs will be linked toInvalidCDRException - If cdrs is not validInvalidAcquisitionException - If the acquisition session is
not validcom.highdeal.hci.ServerFailureException - If the SAP CC BART Server system is not availablecom.highdeal.cnd.message.CommunicationFailureException - If a communication failure
occurs with the distant SAP CC systempublic AcquisitionSessionModel startAcquisitionSession(AcquisitionSessionModel session) throws InvalidAcquisitionException, com.highdeal.hci.ServerFailureException, com.highdeal.cnd.message.CommunicationFailureException
acquisition session of CDRs in the distant SAP CC system.session - The settings of the acquisition session to startInvalidAcquisitionException - If the acquisition session is
not validcom.highdeal.hci.ServerFailureException - If the SAP CC BART Server system is not availablecom.highdeal.cnd.message.CommunicationFailureException - If a communication failure
occurs with the distant SAP CC systempublic AcquisitionSessionModel stopAcquisitionSession(AcquisitionSessionModel session, boolean withErrors) throws InvalidAcquisitionException, com.highdeal.hci.ServerFailureException, com.highdeal.cnd.message.CommunicationFailureException
acquisition sessionsession - The acquisition session to stopwithErrors - A flag which notifies the SAP CC BART Server that some
errors occurred during the acquisitionInvalidAcquisitionException - If the acquisition session is
not validcom.highdeal.hci.ServerFailureException - If the SAP CC BART Server system is not availablecom.highdeal.cnd.message.CommunicationFailureException - If a communication failure
occurs with the distant SAP CC systempublic void connect(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
MessageClient using the round robin
with the distant SAP CC BART Server system with communication timeout set in client application side.hostName - The host name of the SAP CC BART Server systemport - The communication port on which the server waits for operation requeststimeout - The client timeout for the operation requests sent by your Java applicationjava.io.IOException - if the client cannot connect to the server (if server is not running, for instance).public void connect(java.lang.String hostName,
int port)
throws java.io.IOException
MessageClient using the round robin
with the distant SAP CC BART Server system.hostName - The host name of the SAP CC BART Server systemport - The communication port on which the server waits for operation requestsjava.io.IOException - if the client cannot connect to the server (if server is not running, for instance).public void connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout)
throws java.io.IOException
MessageClient using the round robin
with the server.hostName - The host name of the BART Server systemport - The port on which the server waits for operation requestsbindAddress - The address to bind descriptiontimeout - The communication timeout for the operation requests sent by your Java applicationjava.io.IOException - if the client cannot connect to the server (if server is not running, for instance).public void connect(java.lang.String hostname,
int port,
java.lang.String bindAddress,
int timeout,
com.highdeal.cnd.message.ServiceClientTuning config)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException,
java.io.IOException
The cdr service server is identified by its hostname on which it is running and its listening port. Please see BART documentation in order to find the value of this properties.
This client can be bound to one or all the network interface(s) of the running host.
If you want to force this client to be bound to one specific network interface, just specified the argument bindAddress
with a valid IP address or a valid hostname. Otherwise this client will be bound to all the network interfaces.
Whatever the bind address, the port of this client will be choosen automatically between all the available ports of the network interface(s).
After having invoked this method, this client will maintain the connection with the server opened. If the connection is closed because of
network problem, this client will try to open again the connection with the server every 2 seconds. This period can be updated using the
ServiceClientTuning.
hostname - The IP address or the name of the host on which the cdr service server is running (the SAP CC BART Server system). Must not be null.port - The port on which the cdr service server is listening. It is a positive integer up to 65535.bindAddress - The local address (IP address or host name) to which this client has to be bound. If not specified (i.e. is null), this client will be
bound to all the available addresses. The bound port will be the choosen between all the available ports.timeout - The maximal duration in second, the response of a message has to be expected whatever the sent message.
If no timeout is needed, set timeout to NO_TIMEOUT.config - A set of configuration settings dedicated to fine tune the High Availability (HA) of this service.
Must be null by default.
null,
the default settings of ServiceClientTuning are used.java.lang.IllegalStateException - if this client is already connected with a remote cdr service server.java.lang.IllegalArgumentException - if hostname is null or if port is outside the range of a valid port values.java.io.IOException - if this client cannot be connected to the server because of an I/O error.public boolean isConnected()
public void close()