|
SAP Convergent Charging
Java and XML APIs (Core) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.highdeal.cnd.message.StatelessServiceClient
public class StatelessServiceClient
This Java class allows your client application to send some stateless rating and prerating events
to the connected SAP CC Core Server system by using the
Message TCP high-speed technical interface.
Consider the following information in this topic:
This rating and charging client benefits from
the functions provided by the Message TCP technical interface.
Refer to its features about:
When a timeout is associated to a given message client, it must be performed during this limited time.
If this limited time is exceeded, the operation is rolled back but client timeout does not guarantee that related
operations successfully ended (see Technical Reference Guide).
By default, this charging client provides high throughput performances
and very low latency responses.
For very high troughput performances, consider the fine-tuning activity.
By default, this charging client provides high availability services with an SAP CC system with distributed instances in HA setup.
Use setSslContext(javax.net.ssl.SSLContext )
Your charging client (based on this StatefulServiceClient class)
must be initialized via establishing a connection to one of more dispatcher instances available in the distant SAP CC system.
Once at least one dispatcher of the SAP CC system is connected from the client application,
the client application retrieves automatically the list of all available dispatcher instances
on the server system side. It establishes a connection with every one of them automatically.
Depending on your business requirements, you implement one of the following operations in your Java-based client application:
Consult all the online and offline charging services that you can implement in your Java-based client application and in your system landscape.
Consult the SAP CC Library (Application Help) for more information about the online charging services, the charging process and its execution modes (stateless, stateful).
| Nested Class Summary | |
|---|---|
protected static interface |
AsyncRatingServiceClient.RegisterListener
|
| Field Summary | |
|---|---|
static int |
ALL_TRANSACTION
Constant to return all the usage transactions |
static int |
ALL_TRANSACTION_AND_RECURRING
Constant to return all the usage transactions and all the recurring/one-shot transactions |
static int |
CANCELLED
Constant to set up the resolution used when the time to live (TTL) is expired as canceled |
static int |
CONFIRMED
Constant to set up the resolution used when the time to live (TTL) is expired as confirmed |
protected java.util.List<AsyncRatingServiceClient.RegisterListener> |
listeners
|
static int |
MASTER_TRANSACTION
Constant to return the master usage transaction |
static int |
NONE_TRANSACTION
Constant to return no usage transaction |
static int |
POST_RATE_CANCELLATION
|
static int |
POST_RATE_CONFIRMATION
|
protected com.highdeal.cnd.message.AsyncRatingServiceClient.RLListener |
ratingListListener
|
| Constructor Summary | |
|---|---|
StatelessServiceClient()
Creates a non-initialized stateless service client in your client application. |
|
StatelessServiceClient(java.lang.String hostName,
int port)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener,
int timeout)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
int timeout)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
Creates a stateless service client and connect it to a server. |
|
| Method Summary | |
|---|---|
protected void |
addListener(AsyncRatingServiceClient.RegisterListener listener)
|
protected void |
asyncSend(com.highdeal.cnd.message.common.CollectorMessage m,
int maxTimeout,
ResponseHandlerWrapper handler,
com.highdeal.util.IEventListener eventListener)
FOR INTERNAL USE ONLY - Sends asynchronously the message m;
When a response or an exception is received by the client application, it must back the response handler. |
protected void |
beginSession()
FOR INTERNAL USE ONLY - Begins a client session for this thread; All the messages are stored in memory and are not sent until the method sendSession() is called. |
protected boolean |
checkDB()
This method is for internal use only. |
void |
close()
Closes the connection with the connected SAP CC system; This method allows to release all the resources
attached (sockets and buffers) in the charging client. |
void |
connect(InstanceMap imap,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
Deprecated. use connect(String, int, String, FoundLostRatingListener, int, ServiceClientTuning) |
void |
connect(InstanceMap imap,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
Connects this charging client with the SAP CC system by using an instance map;
A timeout must be specified. |
void |
connect(java.lang.String systemName,
java.net.InetSocketAddress... bootDispatcherAddresses)
Connects this charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape. |
void |
connect(java.lang.String systemName,
com.highdeal.barbus.InstanceAddress... bootDispatcherAddresses)
Connects this charging client with the Rating Instances. |
void |
connect(java.lang.String hostname,
int hostport)
Connects this charging client to the
distant SAP CC Core Server system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
No client timeout is specified. |
void |
connect(java.lang.String hostname,
int port,
boolean secure,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
Connects this message client with the Rating Instances. |
void |
connect(java.lang.String hostname,
int hostport,
FoundLostRatingListener ratingListener)
Connects this charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
No client timeout is specified. |
void |
connect(java.lang.String systemName,
int lookupDuration,
java.net.InetSocketAddress discoveryAddress,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config,
java.net.InetSocketAddress... bootDispatcherAddresses)
Connects this message client with the Rating Instances. |
void |
connect(java.lang.String systemName,
int lookupDuration,
java.net.InetSocketAddress discoveryAddress,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config,
com.highdeal.barbus.InstanceAddress... bootDispatcherAddresses)
Connects this charging client with the SAP CC system by using the UDP discovery function. |
void |
connect(java.lang.String hostname,
int hostport,
int timeout)
Connects this charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
A client timeout must be specified. |
void |
connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostname,
int hostport,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener)
Connects this charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape. |
void |
connect(java.lang.String hostname,
int port,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
Connects this message client with the Rating Instances. |
protected int |
currentQueueSize()
This method is for internal use only. |
BootMode |
getBootMode()
Returns which API is used to retrieve from the remote instances, the Instance Map needed for the connection. |
protected com.highdeal.barbus.RoundRobinClient |
getClient()
Deprecated. Deprecated since version 2.0 of SAP CC and should not be called anymore |
ClientOpEventListener |
getClientOpEventListener(ClientOpEventTopic topic)
Gets the client operation event listener used by the client for the specified topic. |
protected java.lang.String |
getClusterName()
Deprecated. Deprecated since version 2.0 of SAP CC Gets the system name. |
protected ServiceClientTuning |
getDefaultServiceClientTuning()
Gets the default service tuning of this client useful to configure connections. |
protected com.highdeal.util.IEventListener |
getEventListenerFromListener(java.lang.Object listener)
|
protected FoundLostRatingListener |
getFoundLostRatingListener()
Returns the rating listener previously set. |
protected com.highdeal.barbus.Topic |
getRatingTopic()
Gets the rating topic of this client used to send rating messages. |
protected com.highdeal.cnd.message.sensor.SensorsManager |
getSensorsManager()
|
javax.net.ssl.SSLContext |
getSslContext()
Returns the SSL context used with secure connections. |
int |
getTimeout()
Returns the client communication timeout in milliseconds for each request (or -1 to wait indefinitely). |
protected com.highdeal.barbus.Topic[] |
getTopicsToSubscribe()
Returns an array of topics that client must subscribe to. |
boolean |
isConnected()
Gets the connected connection status. |
boolean |
isNoTimeout()
Checks if this charging client handles timeout. |
protected boolean |
isValid(ChargeableItem ci,
InvalidItemListener listener)
Checks whether the specified chargeable item is valid or not;
A call back listener has to be given to handle errors. |
protected void |
notifyHeartBeat(com.highdeal.barbus.Client client)
|
protected void |
register(com.highdeal.hmi.IConnectable connectable)
|
protected void |
sendSession()
FOR INTERNAL USE ONLY - All the messages between the last call of the method beginSession() and now for this thread are sent. |
void |
setBootMode(BootMode mode)
Deprecated. |
void |
setClientOpEventListener(ClientOpEventTopic topic,
ClientOpEventListener listener)
Sets the client operation event listener to the specified topics;
It will be notified each time an event corresponding to the registered topics. |
protected void |
setClusterName(java.lang.String name)
Deprecated. Deprecated since version 2.0 of SAP CC |
protected void |
setFoundLostRatingListener(FoundLostRatingListener ratingListener)
Sets the rating listener that will be notified each time a rater instance of the SAP CC system will be
found or lost. |
void |
setHAEventListener(HAEventListener listener)
Deprecated. Deprecated since version 0.0 of SAP CC Sets the |
void |
setNoTimeout(boolean noTimeout)
Sets that this charging client handles timeout. |
void |
setSslContext(javax.net.ssl.SSLContext sslContext)
Sets the SSL context used with secure connections. |
StatelessPostRateResult |
statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
boolean withDetails,
ChargeableItem newCi)
This method is dedicated to the stateless post-rating. |
StatelessPostRateResult |
statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
java.lang.String[] retainedDetails,
ChargeableItem newCi)
Similar to statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem),
but with finest selection of resulting transaction details. |
StatelessPreRateResult |
statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
boolean withDetails,
boolean checkDates)
This method is dedicated to the stateless pre-rating. |
StatelessPreRateResult |
statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
java.lang.String[] retainedDetails,
boolean checkDates)
Similar to statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean),
but with finest selection of resulting transaction details. |
StatelessRateResult |
statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
boolean withDetails,
boolean checkDates)
This main business operation requests the SAP CC system to rate (dynamically determine the price) |
StatelessRateResult |
statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
java.lang.String[] retainedDetails,
boolean checkDates)
Similar to statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean),
but with finest selection of resulting transaction details. |
java.lang.Object[] |
translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.util.Date referenceDate,
java.lang.String[] inValues)
Translates some values by using a translation table. |
java.lang.Object[] |
translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.lang.String[] inValues)
Translates some values by using an instance of translation table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int POST_RATE_CONFIRMATION
public static final int POST_RATE_CANCELLATION
protected java.util.List<AsyncRatingServiceClient.RegisterListener> listeners
protected final com.highdeal.cnd.message.AsyncRatingServiceClient.RLListener ratingListListener
public static final int NONE_TRANSACTION
public static final int MASTER_TRANSACTION
public static final int ALL_TRANSACTION
public static final int ALL_TRANSACTION_AND_RECURRING
public static final int CANCELLED
public static final int CONFIRMED
| Constructor Detail |
|---|
public StatelessServiceClient()
throws java.io.IOException
One of the methods connect() must then be used to connect it to the SAP CC system.
java.io.IOException - if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port)
throws java.io.IOException
hostName - The host name of the serverport - The port on which the server waits for request
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.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 server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.ratingListener - the listener informed when rating is found or lost.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.ratingListener - the listener informed when rating is found or lost.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 server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.bindAddress - address to bind description.ratingListener - the listener informed when rating is found or lost.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 server (if server is not running, for instance)
or if an error occurred reading the currency resources.| Method Detail |
|---|
public void connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.bindAddress - the address to bind description.ratingListener - the FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.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 server (if server is not running, for instance).
public void connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
throws java.io.IOException
hostName - The host name of the serverport - The port on which the server waits for requestbindAddress - The address to bind descriptionratingListener - The FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.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.config - A tuned configuration for this client, can be null.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
@Deprecated
public void connect(InstanceMap imap,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
throws java.io.IOException
connect(String, int, String, FoundLostRatingListener, int, ServiceClientTuning)
imap - The instance mapbindAddress - The address to bind descriptionratingListener - The FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.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.config - A tuned configuration for this client, can be null.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
public StatelessRateResult statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
boolean withDetails,
boolean checkDates)
throws StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
StatelessRatingContext
which is embeded into a StatelessPreRatingContext.
See StatelessPreRatingContext documentation.
chargeCode - The identification code of the master charge configured in SAP CC;
This charge includes a particular price plan dedicated to the stateless rating services.ratingDate - The date of the ratingevent - The event to rate or take into accountcontext - The context of the ratingwithDetails - With all or main details in the returned resultscheckDates - Check date chronology
StatelessRateException - if the rate stateless fails
InvalidItemException - if the item is invalid
ForbiddenChargeException - if the process is forbidden (no access in the price plan of the specified charge, agreement is not valid any longer, the price plan forbids rating or when arguments are not correct)
CommunicationFailureException - if all the rater instances are unavailable in the connected SAP CC system.
ServerFailureException - if a failure occurred on SAP CC Core Server system side
public StatelessRateResult statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
java.lang.String[] retainedDetails,
boolean checkDates)
throws StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
chargeCode - The code of the chargeratingDate - The date of the ratingevent - The event to ratecontext - The context of the ratingretainedDetails - The list of names of transaction details to retain in resulting transaction(s).checkDates - Check date chronology
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean)
public java.lang.Object[] translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.lang.String[] inValues)
throws DoesNotExistException,
CommunicationFailureException,
ServerFailureException
instance of translation table.
tableCode - The code of the translation table which must be usedoperator - The comparison operatordate - The version date of the translation tableinValues - An array of String which represents the input values
Object
DoesNotExistException - thrown if the translation table does
not exist
CommunicationFailureException - if all the raters are unavailable
ServerFailureException - if a failure occurred on server sideTranslateValueOp
public java.lang.Object[] translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.util.Date referenceDate,
java.lang.String[] inValues)
throws DoesNotExistException,
CommunicationFailureException,
ServerFailureException
tableCode - The code of the translation table which must be usedoperator - The comparison operatordate - The version date of the translation tablereferenceDate - The reference date used to check column "start date" and column "end date"inValues - An array of String which represents the input values
Object
DoesNotExistException - thrown if the translation table does not exist
CommunicationFailureException - if all the raters are unavailable
ServerFailureException - if a failure occurred on server sideTranslateValueOp
public StatelessPreRateResult statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
boolean withDetails,
boolean checkDates)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
After a call to this method, the passed StatelessPreRatingContext
is not modified. It must be updated (if needed) explicitly calling
the StatelessPreRateResult.update(StatelessPreRatingContext)
method of the result.
The underlying rating is done using the StatelessRatingContext
associated with the charge code in the
given StatelessPreRatingContext.
If no such StatelessRatingContext exists, it's created
(it will be then really added in the StatelessPreRatingContext
by the further call to
StatelessPreRateResult.update(StatelessPreRatingContext)).
See also StatelessPreRatingContext documentation for limitation
and constraints to follow.
ratingEvent - the event to rate.chargeCode - the code of the charge.preRatingContext - the context of the stateless pre-rating.ratingDate - a date based on which the chargeable item is rated.reservationUID - the unique identifier of the reservation.postrateDeadline - the delay after which the availability of pending
prerating is no longer guarantied in case of post-rate call using
the related reservationUID. A value <= 0 means the pre-rating is
'auto-confirmed' and not available for post-rate.withDetails - with all or main details in results.checkDates - check date chronology.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.
public StatelessPreRateResult statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
java.lang.String[] retainedDetails,
boolean checkDates)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
ratingEvent - the event to rate.chargeCode - the code of the charge.preRatingContext - the context of the stateless pre-rating.ratingDate - a date based on which the chargeable item is rated.reservationUID - the unique identifier of the reservation.postrateDeadline - the delay after which the availability of pending
pre-rating is no longer guarantied in case of post-rate call using
the related reservationUID. A value <= 0 means the pre-rating is
'auto-confirmed' and not available for post-rate.retainedDetails - list of names of transaction details to retain in
resulting transaction(s).checkDates - check date chronology.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean)
public StatelessPostRateResult statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
boolean withDetails,
ChargeableItem newCi)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
After a call to this method, the passed StatelessPreRatingContext
is not modified. It must be updated (if needed) explicitly calling
the StatelessPostRateResult.update(StatelessPreRatingContext)
method of the result.
reservationUID - the unique identifier of the reservation.preRatingContext - the context of the stateless pre-rating.resolution - the resolution (one of POST_RATE_CONFIRMATION
or POST_RATE_CONFIRMATION).withDetails - with all or main details in results.newCi - the new chargeable item, in case of confirmation with new CI.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.
public StatelessPostRateResult statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
java.lang.String[] retainedDetails,
ChargeableItem newCi)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
reservationUID - the unique identifier of the reservation.preRatingContext - the context of the stateless pre-rating.resolution - the resolution (one of POST_RATE_CONFIRMATION
or POST_RATE_CONFIRMATION).retainedDetails - list of names of transaction details to retain in
resulting transaction(s).newCi - the new chargeable item, in case of confirmation with new CI.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem)
protected final int currentQueueSize()
throws CommunicationFailureException
CommunicationFailureException
protected final boolean checkDB()
throws CommunicationFailureException
CommunicationFailureExceptionprotected final com.highdeal.barbus.Topic getRatingTopic()
rating topic of this client used to send rating messages.
protected final com.highdeal.barbus.Topic[] getTopicsToSubscribe()
topics that client must subscribe to.
protected final ServiceClientTuning getDefaultServiceClientTuning()
service tuning of this client useful to configure connections.
public javax.net.ssl.SSLContext getSslContext()
getSslContext in interface com.highdeal.barbus.ISSLContextProviderpublic void setSslContext(javax.net.ssl.SSLContext sslContext)
sslContext - The SSL context used with secure connections
public final void connect(java.lang.String hostname,
int hostport)
throws java.io.IOException
charging client to the
distant SAP CC Core Server system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
No client timeout is specified.
This method is equivalent to: connect(hostname, hostport, -1, null);.
hostname - The name of the machine that hosts a dispatcher instance of the SAP CC Core Server systemhostport - The communication port on which the server system waits for requests on TCP/IP channel
used by the Message TCP/IP technical interface
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running, for example).
public final void connect(java.lang.String hostname,
int hostport,
int timeout)
throws java.io.IOException
charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
A client timeout must be specified.
This method is equivalent to: connect(hostname, hostport, null, timeout);.
hostname - The name of the machine that hosts a dispatcher instance of the SAP CC Core Server systemhostport - The port on which the server waits for requeststimeout - The timeout in milliseconds for each operation request (or -1 to wait indefinitely).
If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending the operation request.
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running for example)
public final void connect(java.lang.String hostname,
int hostport,
FoundLostRatingListener ratingListener)
throws java.io.IOException
charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape;
No client timeout is specified.
hostname - The host name of the serverhostport - The port on which the server waits for requestratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lost
java.io.IOException - if the client cannot connect to the distant SAP CC system (if server is not running, for example)
public final void connect(java.lang.String hostname,
int hostport,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener)
throws java.io.IOException
charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape.
hostname - The host name of the serverhostport - The port on which the server waits for requestbindAddress - The address to bind to, can be nulltimeout - 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 the request.ratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lost.
java.io.IOException - if the client cannot connect to the distant SAP CC system (if server is not running, for example)
java.lang.IllegalArgumentException - if hostname is null or if the port is out of range
public final void connect(java.lang.String hostname,
int port,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
throws java.io.IOException
First of all, this client contacts the boot instance defined by the arguments
hostname - The host name of the serverport - The port on which the server waits for requestbindAddress - The address to bind to, can be nulltimeout - 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 the request.ratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lostconfig - The service tuning configuration
java.io.IOException - if the client cannot connect to the distant SAP CC system (if server is not running, for example).
java.lang.IllegalArgumentException - if hostname is null or if the port is out of range.
public final void connect(java.lang.String hostname,
int port,
boolean secure,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
throws java.io.IOException
First of all, this client contacts the boot instance defined by the arguments
hostname - The host name of the serverport - The port on which the server waits for requestsecure - true if the connection to the server is securebindAddress - The address to bind to, can be nulltimeout - 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.ratingListener - The FoundLostRatingListener that will be notified each time a Rating
Instance will be found or lost.config - The service tuning configuration
java.io.IOException - if the client cannot connect to the server (if server is not running, for example).
java.lang.IllegalArgumentException - if hostname is null or if the port is out if range.
public final void connect(java.lang.String systemName,
java.net.InetSocketAddress... bootDispatcherAddresses)
throws java.io.IOException
charging client to the
distant SAP CC system that is the Online Charging System (OCS) or Offline Charging System (OFCS) in your SAP system landscape.
If systemName is not null, this charging client looks up
for an SAP CC system named systemName during 2 seconds
to discover some rating boot instances registered to the distant system. The charging client uses the
IPv4 multicast address 234.5.6.7:8910.
If some instances have been found, your charging client opens connections with the discovered rater instances.
If the provided systemName is null or empty, or if preceding discovery has failed,
this client will use bootDispatcherAddresses as a boot rating instance address list to connect to the SAP CC system.
Again, the client opens connections with the discovered rater instances.
Prerequisites: At least systemName or bootDispatcherAddresses must be provided.
systemName - The SAP CC system namebootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
java.io.IOException - if the client cannot connect to the server (if server is not running, for example)
java.lang.IllegalArgumentException - if some arguments are badly provided
public final void connect(java.lang.String systemName,
int lookupDuration,
java.net.InetSocketAddress discoveryAddress,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config,
java.net.InetSocketAddress... bootDispatcherAddresses)
throws java.io.IOException
If systemName is not null, this client lookups
for a rating system named systemName during lookupDuration milliseconds
in order to discover some rating boot instances registered to the system.
If some instances have been found, this client opens connections with the discovered rating instances.
If provided systemName is null or empty, or if preceding discovery has failed,
this client will use bootDispatcherAddresses as a boot rating instance address list to connect to the rating system.
Again, the client opens connections with the discovered rating instances.
At least systemName or bootDispatcherAddresses must be provided.
systemName - The SAP CC system namelookupDuration - The system discovery lookup durationdiscoveryAddress - The lookup discovery address, which must be an IPv4 multicast addressbindAddress - The address to bind to, can be nulltimeout - 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.ratingListener - The FoundLostRatingListener that will be notified each time a Rating
Instance will be found or lost.config - The service tuning configurationbootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
java.io.IOException - if the client cannot connect to the server (if server is not running, for example).
java.lang.IllegalArgumentException - if some arguments are badly provided
public final void connect(java.lang.String systemName,
com.highdeal.barbus.InstanceAddress... bootDispatcherAddresses)
throws java.io.IOException
If systemName is not null, this client lookups
for a rating system named systemName during 2 seconds
in order to discover some rating boot instances registered to the system. This client will use
IPv4 multicast address 234.5.6.7:8910.
If some instances have been found, this charging client opens connections with the discovered rating instances.
If provided systemName is null or empty, or if preceding discovery has failed,
this client will use bootDispatcherAddresses as a boot rating instance address list to connect to the rating system.
Again, the client opens connections with the discovered rating instances.
At least systemName or bootDispatcherAddresses must be provided.
systemName - The SAP CC system namebootDispatcherAddresses - a backup rating instance boot dispatcher list, provided only if for some reasons
java.io.IOException - if the client cannot connect to the server (if server is not running, for example).
java.lang.IllegalArgumentException - if some arguments are badly provided
public final void connect(java.lang.String systemName,
int lookupDuration,
java.net.InetSocketAddress discoveryAddress,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config,
com.highdeal.barbus.InstanceAddress... bootDispatcherAddresses)
throws java.io.IOException
If systemName is not null, this client looks up
for a rating system named systemName during lookupDuration milliseconds
in order to discover some rating boot instances registered to the system.
If some instances have been found, this client opens connections with the discovered rating instances.
If provided systemName is null or empty, or if preceding discovery has failed,
this client will use bootDispatcherAddresses as a boot rating instance address list to connect to the rating system.
Again, the client opens connections with the discovered rating instances.
At least systemName or bootDispatcherAddresses must be provided.
systemName - The Rating system namelookupDuration - The system discovery lookup durationdiscoveryAddress - The lookup discovery address, which must be an IPv4 multicast addressbindAddress - The address to bind to, can be nulltimeout - 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 the request.ratingListener - The FoundLostRatingListener that will be notified each time a Rating
Instance will be found or lost.config - The service tuning configurationbootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
java.io.IOException - if the client cannot connect to the server (if server is not running, for example)
java.lang.IllegalArgumentException - if some arguments are badly provided
public final void connect(InstanceMap imap,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener,
ServiceClientTuning config)
throws java.io.IOException
instance map;
A timeout must be specified.
imap - The instance map that describes the SAP CC system to connect to; Cannot be null.bindAddress - The address to bind to, can be nulltimeout - 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 the request.ratingListener - The FoundLostRatingListener that will be notified each time a rater instance will be found or lost.config - The service tuning configuration
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running, for example).public final boolean isNoTimeout()
true if the charging client handles timeoutpublic final void setNoTimeout(boolean noTimeout)
noTimeout - true if your client handles timeout
public final void setClientOpEventListener(ClientOpEventTopic topic,
ClientOpEventListener listener)
client operation event listener to the specified topics;
It will be notified each time an event corresponding to the registered topics.
null for the default topic.
null, then the default listener is set (@link ClientOpEventTopic#DEFAULT).
topic - The topic to plug the client operation event listener tolistener - The client operation event listenerpublic final ClientOpEventListener getClientOpEventListener(ClientOpEventTopic topic)
client operation event listener used by the client for the specified topic.
If the topic is null the default topic listener is returned ( getClientOpEventListener(ClientOpEventTopic.DEFAULT) ).
There is always a default listener for a specific topic.
topic - The topic plugged the client operation event listener
public final int getTimeout()
-1 to wait indefinitely).
-1 if no timeout has been definedpublic final boolean isConnected()
true if the charging client is connected and false otherwise.public final void close()
method allows to release all the resources
attached (sockets and buffers) in the charging client.
@Deprecated public final void setBootMode(BootMode mode)
BootMode.HTTP_BOOT_MODE and BootMode.HTTPS_BOOT_MODE are deprecated, this method is deprecated too.
mode - Is this method is deprecated and to use the Message TCP communication or is
HTTP_BOOT_MODE to use the HTTP communication.public final BootMode getBootMode()
MESSAGE_BOOT_MODE because BootMode.HTTP_BOOT_MODE and BootMode.HTTPS_BOOT_MODE are deprecated.
protected final boolean isValid(ChargeableItem ci,
InvalidItemListener listener)
chargeable item is valid or not;
A call back listener has to be given to handle errors.
ci - The chargeable item to checklistener - The call back listener
true if chargeable item is valid, false otherwise
protected final void asyncSend(com.highdeal.cnd.message.common.CollectorMessage m,
int maxTimeout,
ResponseHandlerWrapper handler,
com.highdeal.util.IEventListener eventListener)
m;
When a response or an exception is received by the client application, it must back the response handler.
m - The message that must be sent asynchronouslymaxTimeout - The maximum timeout before getting a communication failurehandler - The call back handlerprotected final void beginSession()
protected final void sendSession()
protected com.highdeal.util.IEventListener getEventListenerFromListener(java.lang.Object listener)
@Deprecated protected final void setClusterName(java.lang.String name)
name - The system name@Deprecated protected final java.lang.String getClusterName()
@Deprecated public final void setHAEventListener(HAEventListener listener)
Sets the HA listener dedicated to High Availability events;
It will be notified each time the status of an instance of the connected SAP CC system has changed.
listener - The listener for High Availability eventsprotected final void setFoundLostRatingListener(FoundLostRatingListener ratingListener)
rating listener that will be notified each time a rater instance of the SAP CC system will be
found or lost.
ratingListener - The rating listenergetFoundLostRatingListener()protected final FoundLostRatingListener getFoundLostRatingListener()
rating listener previously set.
rating listener previously setsetFoundLostRatingListener(FoundLostRatingListener)@Deprecated protected final com.highdeal.barbus.RoundRobinClient getClient()
inner client.
protected final void notifyHeartBeat(com.highdeal.barbus.Client client)
protected final void register(com.highdeal.hmi.IConnectable connectable)
protected void addListener(AsyncRatingServiceClient.RegisterListener listener)
protected com.highdeal.cnd.message.sensor.SensorsManager getSensorsManager()
|
Document Published: October 2015 (SAP CC 4.0 SP10 and Later) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||