|
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.AsyncStatefulServiceClient
com.highdeal.cnd.message.StatefulServiceClient
public class StatefulServiceClient
This main Java class provides the operations necessary
to implement real-time charging services (event-based or session-based)
in your system landscape by
using the Message TCP technical interface
with very high throughput performances.
Your client application converts the information data about the customer service usage (service consumption) to a chargeable item
and sends this data event to the connected SAP CC system, the online charging system (OCS) for being rated (dynamic pricing) and charged to an account or allowance.
This class provides the necessary methods to implement
online charging services in your system landscape
with or without credit control before the customer service delivery.
Recommendation
You can implement the AsyncStatefulServiceClient class to speed up the processing.
Example
The SAP CC Message Client user interface is
a good example of implementation.
This user interface implements this com.highdeal.cnd.message.StatefulServiceClient class
to allow the SAP CC user to send some charging operations to the SAP CC system for test, demo, or training purposes.
For more information, see
the primary help.
Consider the following information in this topic:
With this Java class, you can implement online event-based charging services or online session-based charging services
via the Message TCP high-speed technical interface.
| Business Services: Online Stateful Charging | Operations | Technical Names (Consider the methods in this Java class) |
|---|---|---|
| Event-based charging without credit control | Immediate charging operation (for direct debiting) | charge(..)
|
| Event-based charging with credit control | Best-effort charging operation | checkLimit(..)
|
| Event-based advice of charge | Blank charging operation | blankCharge(..)
|
| Inverse rating operation | checkLimit(..) in estimation mode
| |
| Multiservice session-based charging (multiple charging sessions of reservations/confirmations) | Quota reservations and consumption confirmations (partial or complete) related to the usage of several customer services or several options of a global service:
|
You manage a multiservice session relating to several customer services with:
Within this multiservice session, you manage the charging sessions
(of quota reservations and consumption confirmations related to the usage of one customer service) with:
You handle the new reservation notifications on partially granted reservations
with a |
| Business monitoring | Spending status monitoring (advanced implementation and customizing) | You manage the spending status monitoring by
|
| Billing process synchronization | Activation of periodic and one-off fees | activate(..)
|
Notes
AsyncStatefulServiceClient class for asynchronous communications and very-high throughput performances.
The following business operations or services are now deprecated and replaced. SAP SE recommends that you do not implement these operations anymore. They will be revoked in newer versions of SAP Convergent Charging.
| Business Services | Deprecated Operations | Technical Names (Consider the methods in this Java class) | Replaced by |
|---|---|---|---|
| Event-based advice of charge | Price estimating operation | getEstimatedPrice(..)
| Replaced by the Blank charging operation
|
| Event-based charging with credit control | Prerating operation | Replaced by the multiservice session-based charging service | |
| Session-based charging (single charging session)
Replaced by: Multiservice session-based charging |
Quota reservation and consumption confirmation related to the usage of one customer service:
|
Replaced by the multiservice session-based charging service |
This charging client benefits
from the functions provided by the Message TCP technical interface.
Refer to its features about:
The connected SAP CC system replies to operation requests with the following data:
Most of services and operations take into account the operational status
of a charging contract (excepting the preRate and the postRate deprecated operations).
This means that an operation exception can be thrown if the operational status of a charging contract
is locked or closed.
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 the client timeout does not guarantee that related
operations successfully ended (see the SAP CC Library (Application Help) for more information).
By default, this charging client provides high throughput performances.
For very high throughput performances, consider the AsyncStatefulServiceClient or the fine-tuning activity.
By default, this charging client provides high availability services with an SAP CC system with distributed instances in HA setup.
You can implement several charging clients in your Java-based client application and you can implement several client applications to manage failover mechanism in your client applications.
You can implement the handling of the notifications sent by the SAP CC Core Server system:
result messages of the charging requests.
The renew reservation notifications are managed via a specialized listener (see advanced implementation).
You can implement in your client application the immediate processing of these notifications.
Use setSslContext(javax.net.ssl.SSLContext )
Your charging client (based on this StatefulServiceClient class)
must be initialized via establishing a connection to one or 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.
You implement the following operations in your Java-based client application to manage a multiservice session:
Note
Refer to the implementation note section if you want to provide the optional reservation renewal function in your system landscape.
Consult the SAP CC Configuration and Implementation Guide to know the necessary configuration settings of the SAP CC system.
Particular constraints apply to the configuration of the pricing logic. Pay attention when designing and configuring price plans dedicated to session-based charging services. Consult the SAP CC Library (Application Help) documentation and the SAP CC Core Tool online Help for more information.
Depending on your business requirements, you implement one of the following operations in your Java-based client application:
You implement this function to provide policy control mechanisms in your system landscape.
The SAP CC system is configured to support the reservation renewal function.
Dedicated Listener
Consult the SAP CC Configuration and Implementation Guide to know the necessary configuration settings of the SAP CC system. Before implementing SAP Convergent Charging in your system landscape, you must configure the systems and the data.
Your client application must release the connections when it ends.
Implement the method.
The following advanced implementation activities are possible. Refer to the implementation note section for more information.
By default, this charging client provides high throughput performances.
You can fine tune the behavior of your client application by implementing the
StatefulServiceClientTuning class.
This function is available in the online charging services. In this Customizing activity you develop a client application and a monitoring client that manages spending status monitoring and report handling.
The SAP CC system is configured to support the spending status monitoring function.
ISpendingStatusReportListener interface.
Develop your own onSpendingStatusReport(...) method
StatefulServiceClient class:
registerSpendingStatusReportListener(...) method
monitorSpendingStatus(...) method.
This method enables you to create, change or cancel a spending status monitoring.
unregisterSpendingStatusReportListener(...) method
Consult the SAP CC Configuration and Implementation Guide to know the necessary configuration settings of the SAP CC system. Before implementing SAP Convergent Charging in your system landscape, you must configure the systems and the data.
ISpendingStatusReportListener interface
A client application must implement the ISpendingStatusReportListener interface to be able to handle monitoring reports.
This function is available in the session-based charging services.
The SAP CC system is configured to support the reservation renewal function.
IReservationRenewalListener interface.
You develop your own onRenewReservation(..) method.
registration of a listener
with the registerReservationRenewalListener(..) method .
StatefulServiceClient class in the client application or in another client application.
This new notification client is responsible for handling
all the renew reservation notifications for all the charging client instances in the client application.
Multiservice session start:
setReservationRenewalListenerId(..) inherited method.
Specify that the multiservice sessions are eligible for renew reservation notifications by the reservation renewal listener identified by the specified identifier.
setExternalData(..) inherited method.
This data is never changed by the SAP CC Core Server system.
Multiservice session update:
When relevant for your business requirements, change external data that is copied to the renew reservation notifications by the connected SAP CC system.
Consult the SAP CC Configuration and Implementation Guide to know the necessary configuration settings of the SAP CC system that relates to the reservation renewal function available in the session-based charging services.
IReservationRenewalListener interface
A client application must implement the IReservationRenewalListener interface to be able to handle Renew Reservation notifications.
The implementation of this interface allows the SAP CC system to inform the client application that additional credit has been made available during a multiservice charging session.
When such a notification occurs, the client application may not have to stop the session and may continue to update the session by making new reservations on charging sessions.
The client application can handle this use case by implementing an IReservationRenewalListener and attaching it to the charging client.
The IReservationRenewalListener interface defines a unique method to handle the notification: onRenewReservation().
This method provides the necessary parameters to handle the notification:
IReservationRenewalAcknowledger object that must be used to acknowledge the receipt of this notification
The acknowledger is an optional feature allowing the client application to tell the SAP CC system the notification has been received and handled.
This feature is useful when the RENEW_RESERVATION_RESEND_ATTEMPTS parameter of the SAP CC system is set with a positive and non-zero value.
Once the SAP CC system is acknowledged by the client application, the resend procedure is canceled for this notification.
Code Snippet
The following code snippet provides an example of how to implement an IReservationRenewalListener interface to receive and handle a Renew Reservation notification:
private class MyReservationRenewalListener implements IReservationRenewalListener {
public void onRenewReservation(String sessionId, String reservationId, byte[] externalData, short resendAttempt, IReservationRenewalAcknowledger acknowledger) {
// Simple implementation: print notification to console
System.out.println("Renew Reservation notification received for session/reservation " + sessionId + " " + reservationId);
// (Optional) Acknowledge the handling message
acknowledger.ack(new IReservationRenewalAcknowledgerListener() {
public void onException(ServerFailureException e) {
// Handle server failure exception
System.err.println("ServerFailureException in acknowledgment: " + e.getMessage());
}
public void onException(IllegalArgumentException e) {
// Handle illegal argument exception
System.err.println("IllegalArgumentException in acknowledgment: " + e.getMessage());
}
public void onException(CommunicationFailureException e) {
// Handle communication failure exception
System.err.println("CommunicationFailureException in acknowledgment: " + e.getMessage());
}
public void onResult() {
// Handle acknowledgment result
System.out.println("Server has received acknowledgment");
}
});
}
}
registerReservationRenewalListener(byte, IReservationRenewalListener) method
To be able to receive and handle Renew Reservation notifications, the client application must use the registerReservationRenewalListener method of the charging client.
The client application must provide a ReservationRenewalListener identifier (rrlId) and the ReservationRenewalListener that can handle the Renew Reservation notification.
The rrlId value can be 1 to 127 included.
Code Snippet
The following code snippet provides an example of how to call the registerReservationRenewalListener() method of the charging client:
private static final String DISPATCHER_HOST = "localhost";
private static final int DISPATCHER_EXT_PORT = 2000;
private static final byte RRLID = 1;
// Initialize the listener
MyReservationRenewalListener myListener = new MyReservationRenewalListener();
// Initialize the stateful service client
StatefulServiceClient client = new StatefulServiceClient(DISPATCHER_HOST, DISPATCHER_EXT_PORT);
// Register a reservation renewal listener
client.register(RRLID, myListener);
unregisterReservationRenewalListener(byte) method
To stop receiving Renew Reservation notifications, the client application must use the unregisterReservationRenewalListener method of the charging client.
The client application must provide a ReservationRenewalListener identifier (rrlId).
The rrlId value can be 1 to 127 included.
Code Snippet
The following code snippet provides an example of how to call the unregisterReservationRenewalListener() method of the charging client:
private static final String DISPATCHER_HOST = "localhost";
private static final int DISPATCHER_EXT_PORT = 2000;
private static final byte RRLID = 1;
// Initialize the listener
MyReservationRenewalListener myListener = new MyReservationRenewalListener();
// Initialize the stateful service client
StatefulServiceClient client = new StatefulServiceClient(DISPATCHER_HOST, DISPATCHER_EXT_PORT);
// Unregister a reservation renewal listener
client.register(RRLID);
In the implementation of the charging process of the service client, additional actions must be taken in the integration code when managing multiservice charging sessions.
On multiservice charging session start:
setReservationRenewalListenerId() of the operation should be used.
setExternalData() of the operation should be used. This data is not read nor changed by SAP CC Server.
Code Snippet
// Create a multiservice charging session start operation
ISessionStartChargingOperation startOp = client.createSessionStartOperation(sessionID, userServiceID, serviceID, consumptionDate);
// Add a charging session operation: reserve
startOp.prepareReserve(reservationId, reservationItem, defaultResolution, ttl, propertyToInverse);
// Indicate that this multiservice charging session is monitored for renew reservation notifications by the reservation renewal listener identified by the rrlId
startOp.setReservationRenewalListenerId(rrlId);
// (Optional) Add external data, that is sent back unchanged in the renew reservation notifications
startOp.setExternalData(externalData);
// Execute the start operation
startOp.execute(sessionResultListener);
On multiservice charging session update:
setExternalData() of the operation should be used. This data is not read nor changed by SAP CC Server.
Code Snippet
// Create a multiservice charging session update operation
ISessionUpdateChargingOperation updateOp = client.createSessionUpdateOperation(sessionID, userServiceID, serviceID, consumptionDate);
// Add a charging session operation: confirm and reserve
updateOp.prepareConfirmAndReserve(reservationId, confirmationItem, reservationItem);
// (Optional) Add external data, that is sent back unchanged in the renew reservation notifications
updateOp.setExternalData(externalData);
// Execute the update operation
updateOp.execute(sessionResultListener);
On multiservice charging session stop:
Consult all the online and offline charging services that you can implement in your Java-based client application.
Consult the SAP CC Library (Application Help) documentation for more information about the online charging services, the charging process and its execution modes.
| 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 |
protected com.highdeal.cnd.message.AsyncRatingServiceClient.RLListener |
ratingListListener
|
| Constructor Summary | |
|---|---|
StatefulServiceClient()
Creates a non-initialized charging client;
Use one of the connect(..) methods to connect this client to the distant SAP CC Core Server system. |
|
StatefulServiceClient(java.lang.String hostName,
int port)
Creates a charging client and connects it to the distant SAP CC Core Server system |
|
StatefulServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
Initializes a charging client and connects it to the distant SAP CC Core Server system; |
|
StatefulServiceClient(java.lang.String hostName,
int port,
int timeout)
Creates a charging client and connects it to the distant SAP CC Core Server system;
A client timeout is specified for the communications. |
|
StatefulServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener)
Initializes a charging client and connects it to the distant SAP CC Core Server system;
A binding network address and a client timeout are specified for the communications with the connected SAP CC system. |
|
| Method Summary | |
|---|---|
PurchaseOrder |
activate(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
int resultType,
boolean ft,
java.util.Date toDate)
Consider the main activate operation for more information. |
PurchaseOrder |
activate(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
int resultType,
java.util.Date toDate)
This main business operation triggers the activation of all the periodic and one-off fees (see recurring/one-shot rates in charges) configured in the provider contracts and subscriptions
relating to the specified subscriber account;
You use this operation to prepare the invoicing and billing operations in an external system. |
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. |
ChargingResult |
blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
ChargeExecutionContext context)
This main business operation requests the SAP CC system to charge in blank mode the specified chargeable item for the specified user service ID and service ID at the specified date. |
PurchaseOrder |
blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
This main business operation requests the SAP CC system to charge in blank mode the specified chargeable item for the specified user service ID and service ID at the specified date. |
PurchaseOrder |
blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
Consider the main blank charge operation for more information;
You can specify if the returned transactions must be filtered according to the transactionTemplate. |
PurchaseOrder |
charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate)
This main business operation requests the SAP CC system to charge the specified chargeable item for the specified user service ID and the specified
service ID at the specified date without transaction selection. |
ChargingResult |
charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
ChargeExecutionContext context)
This main business operation requests the SAP CC system to charge the specified chargeable item
for the specified user service ID and service ID at the specified date. |
PurchaseOrder |
charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
Consider the main charge operation charge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date) |
PurchaseOrder |
charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
Consider the main charge operation charge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date) |
CheckLimitResult |
checkLimit(ChargeableItem item,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
java.lang.String propertyName,
java.math.BigDecimal precision,
Money limitAmount,
boolean estimationMode)
This main business operation requests either an inverse rating operation or a best-effort charging operation. |
CheckLimitResult |
checkLimit(ChargeableItem item,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
java.lang.String propertyName,
java.math.BigDecimal precision,
Money limit,
boolean estimationMode,
int ts,
boolean ft)
Consider the main checkLimit(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date, java.lang.String, java.math.BigDecimal, com.highdeal.currency.Money, boolean) check limit operation for more information. |
CleanupResult |
cleanup(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
java.util.Date toDate,
int resultType)
This main business operation triggers the cleanup process in the connected SAP CC Core Server system; The SAP CC system goes through all the existing rating records of a given subscription and deletes the ones that are not relevant at all. |
CleanupResult |
cleanup(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
java.util.Date toDate,
int resultType,
boolean ft)
Consider the main cleanup operation for more information. |
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,
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 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. |
ISessionStartChargingOperation |
createSessionStartOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
This method allows you to create a start operation to manage the service consumption by an end customer. |
ISessionStopChargingOperation |
createSessionStopOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
This stop operation confirms (partially or totally) previous reservations and is able to cancel some other reservations. |
ISessionUpdateChargingOperation |
createSessionUpdateOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
This method allows you to create an update operation to
process an update event of a multiservice session-based charging sequence. |
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. |
PurchaseOrder |
getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation
This main business operation requests the SAP CC system to
estimate the price of a usage consumption (white rating).
Asks the server to rate the specified chargeable item for the specified user service ID and the specified service ID at the specified date without impacting the database. |
PurchaseOrder |
getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation
Consider the main get estimated price operation for more information.
Estimates the price of a usage consumption (white rating). |
PurchaseOrder |
getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation
Consider the main get estimated price operation for more information.
Estimates the price of a usage consumption (white rating). |
protected com.highdeal.util.IEventListener |
getEventListenerFromListener(java.lang.Object listener)
|
protected FoundLostRatingListener |
getFoundLostRatingListener()
Returns the rating listener previously set. |
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). |
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. |
IMonitorSpendingStatusResultListener.ISpendingStatusMonitoringResult |
monitorSpendingStatus(java.lang.String monitoringId,
byte ssrlId,
java.lang.String userServiceId,
java.lang.String[] spendingStatusIds,
int ttl)
Manages the monitoring of spending statuses concerning the charging contract that relates to the specified userServiceId. |
protected void |
notifyHeartBeat(com.highdeal.barbus.Client client)
|
PostRateResult |
postRate(long reservationUID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
boolean ft,
ChargeableItem newCi)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the session-based charging services Asks the server to post-rate the specified reservation unique identifier using the given resolution. If more than one rating record for that reservation identifier are present into the database, the operation chooses one arbitrarily. In that case, the operation logs the reservation identifier. When resolution is CONFIRMED then a new ChargeableItem may be passed. Not like PostRateOp, there are serviceID and
userServiceID parameters. They have no functional meaning and are not mandatory, but setting
them with same value as for preRate may increase the performance in multi-server
configuration.
|
PostRateResult |
postRate(long reservationUID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
ChargeableItem newCi)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the session-based charging services Asks the server to post-rate the specified reservation unique identifier using the given resolution. If more than one rating record for that reservation identifier are present into the database, the operation chooses one arbitrarily. In that case, the operation logs the reservation identifier. When resolution is CONFIRMED then a new ChargeableItem may be passed. Not like PostRateOp, there are serviceID and
userServiceID parameters. They have no functional meaning and are not mandatory, but setting
them with same value as for preRate may increase the performance in multi-server
configuration.
|
PreRateResult |
preRate(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int resultType,
boolean ft,
long reservationUID,
int defaultResolution,
long ttl)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the session-based charging services This main operation asks the SAP CC system to prerate the specified chargeable item for the specified user service ID and the specified service ID at the specified date, and using the passed reservation unique identifier, default resolution and time to live. The operation allows the use of the same reservation unique identifier for more than one prerating. This case is managed at post-rating time. |
PreRateResult |
preRate(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int resultType,
long reservationUID,
int defaultResolution,
long ttl)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the session-based charging services Consider the main prerate operation for more information.
Asks the server to prerate the specified chargeable item for the specified user service ID and the
specified service ID at the specified date, and using the passed reservation unique identifier, default
resolution and time to live. The operation allows the use of the same reservation unique identifier for
more than one prerating. This case is managed at postrating time.
|
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. |
StartRateResult |
startRate(ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int defaultResolution,
long ttl,
int resultType,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This main business operation represents the start of a session-based charging operation. It is in charge of rating the reservation chargeable item and doing the related counter reservations. It creates a rating session (keeping the reservation chargeable item) and returns a rating result used to reserve the balance. The parameters ttl and defaultResolution
are used by the session cleaning process to confirm or cancel the
last counter reservations after a given amount of time.
The result of this method contains either the amount or all the transactions to reserve. These transactions are not provided to the TIF since they are not the final ones. |
StartRateResult |
startRate(ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int defaultResolution,
long ttl,
int resultType,
int cleanupResultType,
boolean ft,
java.lang.String propertyToInverse)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services
Consider the main |
StopRateResult |
stopRate(ChargeableItem confirmationItem,
java.lang.String sessionID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This main business operation represents the termination of a session-based charging sequence. Firstly, it retrieves the rating session and re-rate the reservation item to compute a first rating result used by the client application to cancel the previous balance reservation. The transactions from this rating result are provided to the TIF. Secondly, it consolidates a chargeable item for confirmation using both the reservation one from the rating session and the confirmation one if present. This chargeable item is rated and previously reserved counters are committed into the database. A second rating result is then available for the client application to confirm the balance reservation. The transactions from this rating result are also provided to the TIF. This method manages also the session cancellation case by setting the resolution parameter to CANCELLED.
It retrieves the rating session first and cancels the
related counter reservations coming from either a
previous session start or a session update.
The rating result that is returned is empty in case of cancellation.
Finally, the rating session is removed and the session identifier becomes available for next sessions. |
StopRateResult |
stopRate(ChargeableItem confirmationItem,
java.lang.String sessionID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
int cleanupResultType,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services
Consider the main |
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 a translation table |
UpdateRateResult |
updateRate(ChargeableItem confirmationItem,
ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int resultType,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This main business operation represents the update of a charging session.
Firstly, it retrieves the rating session and re-rate the reservation item
to compute a first rating result used by the client application
to cancel the previous balance reservation.
The transactions from this rating result are provided to the TIF.
|
UpdateRateResult |
updateRate(ChargeableItem confirmationItem,
ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int resultType,
int cleanupResultType,
boolean ft)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services
Consider the main |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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 StatefulServiceClient()
charging client;
Use one of the connect(..) methods to connect this client to the distant SAP CC Core Server system.
public StatefulServiceClient(java.lang.String hostName,
int port)
throws java.io.IOException
charging client and connects it to the distant SAP CC Core Server system
hostName - The host name of the SAP CC Core Server systemport - The communication port on which the SAP CC system waits for requests via
the Message TCP technical interface
java.io.IOException - if the client cannot connect to the SAP CC system.
public StatefulServiceClient(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
charging client and connects it to the distant SAP CC Core Server system;
A client timeout is specified for the communications.
hostName - The host name of the SAP CC Core Server systemport - The communication port on which the SAP CC system waits for request via the Message TCP technical interfacetimeout - 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 SAP CC system (if the server system is not running, for instance)
public StatefulServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
throws java.io.IOException
charging client and connects it to the distant SAP CC Core Server system;
hostName - The host name of the SAP CC Core Server systemport - The communication port on which the SAP CC system waits for requestsratingListener - The listener informed when rating is found or lost
java.io.IOException - if the client cannot connect to the SAP CC system
public StatefulServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
int timeout,
FoundLostRatingListener ratingListener)
throws java.io.IOException
charging client and connects it to the distant SAP CC Core Server system;
A binding network address and a client timeout are specified for the communications with the connected SAP CC system.
hostName - The host name of the SAP CC Core Server systemport - The communication port on which the SAP CC system waits for requestsbindAddress - The network address to bind totimeout - 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 listener informed when rating is found or lost
java.io.IOException - if the client cannot connect to the SAP CC system| Method Detail |
|---|
public PurchaseOrder charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
charge operation charge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date)
Asks the server to rate the specified chargeable item for the specified user service ID and the specified service ID at the specified date. This operation may conflict with the prerating feature. Do not use this operation if some preratings are not post-rated.
ci - The ChargeableItem to rateserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRINGft - Flag to specify if the returned transactions must be filtered according to the transactionTemplate
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public PurchaseOrder charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
charge operation charge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date)
Asks the server to rate the specified chargeable item for the specified user service ID and the specified service ID at the specified date with transaction filtered selection. This operation may conflict with the prerating feature. Do not use this operation if some preratings are not post-rated.
ci - the ChargeableItem to rateserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerts - the transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public PurchaseOrder charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
This main business operation requests the SAP CC system to
charge the specified chargeable item for the specified user service ID and the specified
service ID at the specified date without transaction selection.
Note
This operation may conflict with the prerating feature that is now deprecated. Do not use this operation if some prerating operations are not post-rated.
ci - the chargeable item to chargeserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customer
purchase order resulting from the charging process
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public ChargingResult charge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
ChargeExecutionContext context)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
This main business operation requests the SAP CC system to
charge the specified chargeable item
for the specified user service ID and service ID at the specified date.
The behavior of the operation as well as the content of the result of the operation can be configured
using an execution context.
Note
This operation may conflict with the prerating feature that is now deprecated. Do not use this operation if some prerating operations are not post-rated.
ci - The chargeable item to chargeserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customercontext - The context in which the operation is executed
result of the charging operation
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public PurchaseOrder blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
This main business operation requests the SAP CC system to charge in blank mode the specified chargeable item for the specified user service ID and service ID at the specified date.
This operation is equivalent to charge operation
but the blank mode means that no data is committed to the database.
Caution
If the transaction processor does not take care about the database transaction (transaction processor which stores the transactions into a file by example), the transaction processor action will not be rollbacked.
ci - the chargeable item to adviseserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customerts - the transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public PurchaseOrder blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
main blank charge operation for more information;
You can specify if the returned transactions must be filtered according to the transactionTemplate.
ci - the ChargeableItem to estimate the priceserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRINGft - Flag to specify if the returned transactions must be filtered according to the transactionTemplate
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public ChargingResult blankCharge(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
ChargeExecutionContext context)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
This main business operation requests the SAP CC system to charge in blank mode the specified chargeable item for the specified user service ID and service ID at the specified date.
The behavior of the operation as well as the content of the result of the operation can be configured
using an execution context.
This operation is equivalent to the charge operation
but the blank mode means that no data is committed to the database.
Caution
If the transaction processor does not take care about the database transaction (transaction processor which stores the transactions into a file by example), the transaction processor action will not be rollbacked.
ci - The chargeable item to adviseserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customercontext - The context in which the operation is executed
result of the charging operation
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PurchaseOrder getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate)
throws ForbiddenChargeException,
InvalidItemException,
ServerFailureException,
CommunicationFailureException
Asks the server to rate the specified chargeable item for the specified user service ID and the specified service ID at the specified date without impacting the database.
ci - The chargeable item to determine the priceserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customer
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PurchaseOrder getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts)
throws ForbiddenChargeException,
InvalidItemException,
ServerFailureException,
CommunicationFailureException
get estimated price operation for more information.
Estimates the price of a usage consumption (white rating).
Asks the server to rate the specified chargeable item for the specified user service ID and the specified
service ID at the specified date without impacting the database.
ci - the ChargeableItem to rateserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerts - the transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PurchaseOrder getEstimatedPrice(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int ts,
boolean ft)
throws ForbiddenChargeException,
InvalidItemException,
ServerFailureException,
CommunicationFailureException
get estimated price operation for more information.
Estimates the price of a usage consumption (white rating).
Asks the server to rate the specified chargeable item for the specified user service ID and the specified
service ID at the specified date without impacting the database.
ci - The ChargeableItem to rateserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customerts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRINGft - Sets if the returned transactions must be filtered according to the transactionTemplate
PurchaseOrder
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public CheckLimitResult checkLimit(ChargeableItem item,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
java.lang.String propertyName,
java.math.BigDecimal precision,
Money limitAmount,
boolean estimationMode)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
CannotInverseException,
ServerFailureException,
CommunicationFailureException
The chargeable item that is specified must contain a value for the property to inverse.
This value represents the maximum value return for the property to inverse.
The value must be valid regarding the precision specified.
This business operation assumes that the value of the property to inverse is between 0
and the maximum value.
Once answered, you can request a charging operation to reserve a credit on a prepaid account.
Note
To implement a credit reservation function in online event-based charging services, you can implement the inverse rating operation by specifying the estimation mode
to false (see estimationMode). In that case, the SAP CC system automatically processes a charging operation after the inverse rating operation.
Options: You can specify the precision. The precision of the result must be one of the following: 1, 0.1, 0.01, 0.001 ...
Note
When the limit amount of money is not provided (null value), the limit is retrieved from the account
balances.
Caution
When the processed charging plan depends on the property to inverse, the inverse rating operation can return a value which does not correspond to the exact limit, and thus fails when really charged.
The configuration of the pricing catalog of a service provider (master data) is very important. Check the pricing logic (price plan) and the charging logic (charging plan) of the charges customized in the charge plans (or the offers) that are activated in the provider contract (or subscription) of the end customer who uses the customer service.
item - The chargeable item to use for the inverse rating or best-effort chargingserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerpropertyName - the name of the property used by the inverse rating functionprecision - the precision for the computed property valuelimitAmount - the limit amount to inverse (must be positive or null)estimationMode - the estimation mode (false for a best-effort charging operation; true for an inverse rating operation)
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
CannotInverseException - if the inverse rating cannot be performed
ServerFailureException - if the SAP CC system is not available
CommunicationFailureException - if a communication failure occurs
public CheckLimitResult checkLimit(ChargeableItem item,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
java.lang.String propertyName,
java.math.BigDecimal precision,
Money limit,
boolean estimationMode,
int ts,
boolean ft)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
CannotInverseException,
ServerFailureException,
CommunicationFailureException
checkLimit(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date, java.lang.String, java.math.BigDecimal, com.highdeal.currency.Money, boolean) check limit operation for more information.
This operation represents the property limit check operation also called Inverse Rating.
The chargeable item that is sent during this operation must contain a value for the property
to inverse. This value represents the maximum value return for the property to inverse. The
value must be valid regarding the precision used.
This operation assumes that the value of the property to inverse is between 0
and the maximum value.
An inverse rating is performed followed by a final rating if
the estimation mode is set to false.
In addition, the client has the ability to specify the precision.
The precision of the result must be one of the following: 1, 0.1, 0.01, 0.001 ...
When the limit amount of money is not provided (null value), the limit is retrieved from the account
balances.
Note:
- When the Charging Plan depends on the property to inverse, the Check Limit operation can
return a value which does not correspond to the exact limit,
and thus fails when really charged.
item - the ChargeableItem to rateserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerpropertyName - the name of the property used by the inverse rating processprecision - the precision for the computed property valuelimit - the limit to inverse (must be positive or null)estimationMode - the estimation modets - the transaction selection NONE_TRANSACTION, MASTER_TRANSACTION,
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRINGft - sets if the returned transactions must be filtered according to the transactionTemplate
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
CannotInverseException - if the check limit cannot be performed
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PreRateResult preRate(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int resultType,
long reservationUID,
int defaultResolution,
long ttl)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
PreRateException,
ServerFailureException,
CommunicationFailureException
prerate operation for more information.
Asks the server to prerate the specified chargeable item for the specified user service ID and the
specified service ID at the specified date, and using the passed reservation unique identifier, default
resolution and time to live. The operation allows the use of the same reservation unique identifier for
more than one prerating. This case is managed at postrating time.
ci - the ChargeableItem to rate.serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerresultType - the result type (see PreRateOp for the
constants)reservationUID - the reservationUID used later to post-ratedefaultResolution - the default resolution to be used at expiration (see
PreRateOp}for the constants)ttl - the time to live given in seconds
PreRateResult
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
PreRateException - if a prerating error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PreRateResult preRate(ChargeableItem ci,
java.lang.String serviceID,
java.lang.String userServiceID,
java.util.Date consumptionDate,
int resultType,
boolean ft,
long reservationUID,
int defaultResolution,
long ttl)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
PreRateException,
ServerFailureException,
CommunicationFailureException
ci - the ChargeableItem to rate.serviceID - the service IDuserServiceID - the user service ID. This parameter is used as key for determining the partition ID for
guiding the request towards the related rater. So it cannot be set to null. If this parameter is
set to null, ForbiddenChargeException is thrown with ILLEGAL_ARGUMENT as reason.consumptionDate - the consumption dateresultType - the result type (see PreRateOp for the
constants)ft - sets if the returned transactions must be filtered according to the transactionTemplatereservationUID - the reservationUID used later to post-ratedefaultResolution - the default resolution to be used at expiration (see
PreRateOp}for the constants)ttl - the time to live given in seconds
PreRateResult
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
PreRateException - if a prerating error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PostRateResult postRate(long reservationUID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
ChargeableItem newCi)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
PostRateException,
ServerFailureException,
CommunicationFailureException
ChargeableItem may be passed. PostRateOp, there are serviceID and
userServiceID parameters. They have no functional meaning and are not mandatory, but setting
them with same value as for preRate may increase the performance in multi-server
configuration.
reservationUID - the reservationUID to post-rateserviceID - the service ID (no functional meaning, used only as load balancing key on HA configuration)userServiceID - the user service ID (no functional meaning, used only as load balancing key on HA
configuration)resolution - the resolution to be used (see PostRateOp for
the constants)resultType - the result type (see PostRateOp for the
constants)newCi - the new ChargeableItem to be used for this post-rating
PostRateResult
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
PostRateException - if a prerating error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
@Deprecated
public PostRateResult postRate(long reservationUID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
boolean ft,
ChargeableItem newCi)
throws InvalidItemException,
ForbiddenChargeException,
TransactionClearingException,
PostRateException,
ServerFailureException,
CommunicationFailureException
ChargeableItem may be passed. PostRateOp, there are serviceID and
userServiceID parameters. They have no functional meaning and are not mandatory, but setting
them with same value as for preRate may increase the performance in multi-server
configuration.
reservationUID - the reservationUID to post-rateserviceID - the service ID (no functional meaning, used only as load balancing key on HA configuration)userServiceID - the user service ID (no functional meaning, used only as load balancing key on HA
configuration)resolution - the resolution to be used (see PostRateOp for
the constants)resultType - the result type (see PostRateOp for the
constants)ft - sets if the returned transactions must be filtered according to the transactionTemplatenewCi - the new ChargeableItem to be used for this post-rating
PostRateResult
InvalidItemException - if the chargeable item is not valid
ForbiddenChargeException - if charging is forbidden
TransactionClearingException - if a transaction clearing error occurs
PostRateException - if a prerating error occurs
ServerFailureException - if the server is not available
CommunicationFailureException - if a communication failure occurs
public PurchaseOrder activate(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
int resultType,
java.util.Date toDate)
throws ForbiddenChargeException,
ActivateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
subscriptions
relating to the specified subscriber account;
You use this operation to prepare the invoicing and billing operations in an external system.
The operation returns the related purchase order.
subscriberAccountCode - The identification code of the subscriber account representing
an end customer of a service providerserviceProvider - The identification code of the service provider, owner of both the
pricing catalogs and
the customer master data (subscriber accounts, provider contracts, subscriptions, ...)resultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION or ALL_TRANSACTION).toDate - The reference date for triggering the periodic fees. Only fees for which the trigger date is
before or equal to this reference date will be triggered and will generate a transaction (or not -
not mandatory -)
related purchase order that includes the list of generated transactions (if required and if
some transactions exist)- one-shot and recurring ones -. The purchase order contains
the total of generated amounts and the state of the purchase.
ForbiddenChargeException - if the SAP CC system cannot retrieve the contract (or subscription) or if a
parameter is malformed
ActivateException - if the contract (or subscription) cannot be activated for several
reasons (see ActivateException for more information)
TransactionClearingException - if the Transaction Processor plugged, is not able
to clear at least one of the generated transactions
ServerFailureException - if the targeted rater instance (of the SAP CC system) is
not ready to treat the activation request
CommunicationFailureException - if the targeted rater instance cannot be reached by
the Packets over TCP communication layer
public PurchaseOrder activate(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
int resultType,
boolean ft,
java.util.Date toDate)
throws ForbiddenChargeException,
ActivateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
activate operation for more information.
Activates all the periodic and one-off fees for a specified subscriber account and returns the related purchase order; Transaction filtering is available.
subscriberAccountCode - The identification code of the subscriber accountserviceProvider - The code of the service providerresultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION or CHARGING_RESULT).ft - The flag to specify if the returned transactions must be filtered according to the transactionTemplatetoDate - The reference date for triggering the recurring fees. Only fees for which the trigger date is
before or equal to this reference date will be trigger and will generate a transaction (or not -
not mandatory -)
ForbiddenChargeException - if the SAP CC system cannot retrieve the subscription or if a parameter is
malformed.
ActivateException - if the subscription cannot be activated for diverse reasons (ActivateException
for more info about reasons).
TransactionClearingException - if the Transaction Processor plugged, is not able
to clear at least one of the generated transactions
ServerFailureException - if the targeted rater instance is not ready to treat the activation request
CommunicationFailureException - if the targeted rater instance cannot be reached by the Packets over TCP communication
layer
public CleanupResult cleanup(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
java.util.Date toDate,
int resultType)
throws ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException,
CleanupException
More precisely, the SAP CC system executes the post-rating process for the
expired records, using their default resolution (passed into the PreRateOp).
As for the postRate, transactions may be computed. In such a case, these transactions are sent to
the TIF connector and can be returned if asked.
You must specify a reference date (see toDate) that is used by the SAP CC system to determine whether a rating record is expired or not.
If you do not implement this operation in your client application, an SAP CC administrator can manually trigger the cleanup operation (see the Admin+ user interface) or configure the SAP CC system to regularly process the cleanup (see the CLEANUP_SCHEDULER_ENABLED system parameter).
PreRateOp
subscriberAccountCode - The identification code of the subscriber accountserviceProvider - The code of the service providerresultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION or CHARGING_RESULT)toDate - The reference date which is used to determine whether a rating record is expired or not. This
parameter cannot be null otherwise the ForbiddenChargeException exception with ILLEGAL_ARGUMENT
will be thrown.
ForbiddenChargeException - if the server cannot retrieve the subscription or if a parameter is
malformed.
TransactionClearingException - if the Transaction Processor plugged on the PnR output, is not able
to clear at least one of the generated transactions.
ServerFailureException - if the targeted rater instance is not ready to treat the activation request
CommunicationFailureException - the targeted rater instance cannot be reached by the Packets over TCP communication
layer (see the Message Tcp technical interface of SAP CC).
CleanupException - if the date or the subscription or the currency is not valid.
public CleanupResult cleanup(java.lang.String subscriberAccountCode,
java.lang.String serviceProvider,
java.util.Date toDate,
int resultType,
boolean ft)
throws ForbiddenChargeException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException,
CleanupException
cleanup operation for more information.
This method implements the cleanup process. It goes through the rating records of a given subscription and
deletes the ones that are not relevant at all. More precisely, it executes the post-rating process for the
expired records, using their default resolution (passed into the PreRateOp).postRate, transactions may be computed. In such a case, these transactions are
sent to the TIF connector and can be returned if asked. PreRateOp
subscriberAccountCode - The code of the subscriber accountserviceProvider - The code of the service providerresultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION or ALL_TRANSACTION, CHARGING_RESULT).ft - sets if the returned transactions must be filtered according to the transactionTemplatetoDate - the reference date which is used to determine whether a rating record is expired or not. This
parameter cannot be null otherwise the ForbiddenChargeException exception with ILLEGAL_ARGUMENT
will be thrown.
ForbiddenChargeException - if the server cannot retrieve the subscription or if a parameter is
malformed.
TransactionClearingException - if the Transaction Processor plugged on the PnR output, is not able
to clear at least one of the generated transactions.
ServerFailureException - if the targeted rater instance is not ready to treat the activation request.
CommunicationFailureException - the targeted rater instance cannot be reached by the Packets over TCP communication
layer.
CleanupException - if the date or the subscription or the currency is not valid.
public java.lang.Object[] translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.lang.String[] inValues)
throws DoesNotExistException,
CommunicationFailureException,
ServerFailureException
tableCode - The identification 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 a communication failure occurs
ServerFailureExceptionTranslateValueOp
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 identification 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 the column "start date" and the 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 a communication failure occurs
ServerFailureExceptionTranslateValueOp
@Deprecated
public StartRateResult startRate(ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int defaultResolution,
long ttl,
int resultType,
boolean ft)
throws InvalidItemException,
ForbiddenChargeException,
StartRateException,
ServerFailureException,
CommunicationFailureException,
TransactionClearingException
ttl and defaultResolution
are used by the session cleaning process to confirm or cancel the
last counter reservations after a given amount of time.
reservationItem - The reservation item (mandatory)sessionID - The session identifier which has to be uniqueserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerdefaultResolution - The default resolution of the rating session at expiration time (CANCELLED or
CONFIRMED)ttl - The time to live expressed in secondsresultType - The rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)ft - Sets if the returned transactions must be filtered according to the transactionTemplate
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
StartRateException - when rating session cannot be created
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reached
TransactionClearingException - when transactions cannot be clearedupdateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, boolean),
updateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, int, boolean),
stopRate(ChargeableItem, String, String, String, int, int, boolean),
stopRate(ChargeableItem, String, String, String, int, int, int, boolean)
@Deprecated
public StartRateResult startRate(ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int defaultResolution,
long ttl,
int resultType,
int cleanupResultType,
boolean ft,
java.lang.String propertyToInverse)
throws InvalidItemException,
ForbiddenChargeException,
StartRateException,
ServerFailureException,
CommunicationFailureException,
TransactionClearingException
Consider the main start rate operation for more information.
This operation represents the beginning of a session-based charging sequence. It creates a charging session.
It is in charge of rating the reservation chargeable item and
doing the related counter reservations.
It creates a rating session (keeping the reservation chargeable item)
and returns a rating result used to reserve the balance.
If the reservation fails due to a low-credit, an inverse rating may be attempted if the property name of the
property to inverse is provided. This mechanism is known as best effort reservation. This property name is saved
in the rating session to avoid providing it again or changing it at update time.
The parameters ttl and defaultResolution
are used by the session cleaning process to confirm or cancel the
last counter reservations after a given amount of time.
The result of this method contains either the amount or all the transactions to reserve.
These transactions are not provided to the TIF since they are not the final ones.
reservationItem - the reservation item (mandatory)sessionID - the session identifier which has to be uniqueserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerdefaultResolution - the default resolution of the rating session at expiration time (CANCELLED or
CONFIRMED)ttl - the time to live expressed in secondsresultType - the rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)cleanupResultType - the session cleanup rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)ft - sets if the returned transactions must be filtered according to the transactionTemplatepropertyToInverse - the name of the property to inverse in case of best effort reservation
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
StartRateException - when rating session cannot be created
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reached
TransactionClearingException - when transactions cannot be cleared
@Deprecated
public UpdateRateResult updateRate(ChargeableItem confirmationItem,
ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int resultType,
boolean ft)
throws ForbiddenChargeException,
InvalidItemException,
UpdateRateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
Firstly, it retrieves the rating session and re-rate the reservation item
to compute a first rating result used by the client application
to cancel the previous balance reservation.
The transactions from this rating result are provided to the TIF.
Secondly, it consolidates a chargeable
item for confirmation using both the reservation one from the rating session
and the confirmation one if present. This chargeable item is rated and
previously reserved counters are updated into the database.
A second rating result is then available for the client application
to confirm the balance reservation. The transactions from
this rating result are also provided to the TIF.
Thirdly, the engine consolidates a chargeable item for reservation using
both the old reservation item (from the rating session) and the provided one
(if not present, the old one is used instead). It rates this new reservation
item considering the update date and does the related counter reservations.
A third rating result is available for balance reservation.
Finally, it updates the rating session with the new reservation chargeable item.
confirmationItem - the confirmation item (optional, null value is accepted)reservationItem - the reservation item (optional, null value is accepted)sessionID - the session identifier previously usedserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerresultType - the rating result type to be returned (NONE_TRANSACTION or
MASTER_TRANSACTION, ALL_TRANSACTION)ft - sets if the returned transactions must be filtered according to the transactionTemplate
UpdateRateResult
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
UpdateRateException - when rating session cannot be updated
TransactionClearingException - when transactions cannot be cleared
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reachedstartRate(ChargeableItem, String, Date, String, String, int, long, int, int, boolean, String),
startRate(ChargeableItem, String, Date, String, String, int, long, int, boolean),
stopRate(ChargeableItem, String, String, String, int, int, boolean),
stopRate(ChargeableItem, String, String, String, int, int, int, boolean)
@Deprecated
public UpdateRateResult updateRate(ChargeableItem confirmationItem,
ChargeableItem reservationItem,
java.lang.String sessionID,
java.util.Date consumptionDate,
java.lang.String serviceID,
java.lang.String userServiceID,
int resultType,
int cleanupResultType,
boolean ft)
throws ForbiddenChargeException,
InvalidItemException,
UpdateRateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
Consider the main update rate operation for more information.
This operation represents the update of a session-based charging sequence.
Firstly, it retrieves the rating session and re-rate the reservation item
to compute a first rating result used by the client application
to cancel the previous balance reservation.
The transactions from this rating result are provided to the TIF.
Secondly, it consolidates a chargeable
item for confirmation using both the reservation one from the rating session
and the confirmation one if present. This chargeable item is rated and
previously reserved counters are updated into the database.
A second rating result is then available for the client application
to confirm the balance reservation. The transactions from
this rating result are also provided to the TIF.
Thirdly, the engine consolidates a chargeable item for reservation using
both the old reservation item (from the rating session) and the provided one
(if not present, the old one is used instead). It rates this new reservation
item considering the update date and does the related counter reservations.
A third rating result is available for balance reservation.
Finally, it updates the rating session with the new reservation chargeable item.
confirmationItem - the confirmation item (optional, null value is accepted)reservationItem - the reservation item (optional, null value is accepted)sessionID - the session identifier previously usedserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - the date the service was consumed by the end customerresultType - the rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)cleanupResultType - the session cleanup rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)ft - sets if the returned transactions must be filtered according to the transactionTemplate
UpdateRateResult
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
UpdateRateException - when rating session cannot be updated
TransactionClearingException - when transactions cannot be cleared
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reached
@Deprecated
public StopRateResult stopRate(ChargeableItem confirmationItem,
java.lang.String sessionID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
boolean ft)
throws ForbiddenChargeException,
InvalidItemException,
StopRateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
resolution parameter to CANCELLED.
It retrieves the rating session first and cancels the
related counter reservations coming from either a
previous session start or a session update.
The rating result that is returned is empty in case of cancellation.
confirmationItem - The confirmation item (optional, null value is accepted)sessionID - The session identifier previously usedserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceresolution - The resolution of the rating session (CANCELLED or
CONFIRMED)resultType - The rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)ft - sets if the returned transactions must be filtered according to the transactionTemplate
StopRateResult
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
StopRateException - when rating session cannot be stopped
TransactionClearingException - when transactions cannot be cleared
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reachedstartRate(ChargeableItem, String, Date, String, String, int, long, int, int, boolean, String),
startRate(ChargeableItem, String, Date, String, String, int, long, int, boolean),
updateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, boolean),
updateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, int, boolean)
@Deprecated
public StopRateResult stopRate(ChargeableItem confirmationItem,
java.lang.String sessionID,
java.lang.String serviceID,
java.lang.String userServiceID,
int resolution,
int resultType,
int cleanupResultType,
boolean ft)
throws ForbiddenChargeException,
InvalidItemException,
StopRateException,
TransactionClearingException,
ServerFailureException,
CommunicationFailureException
Consider the main stop rate operation for more information.
This operation class represents the stop of a session-based charging.
Firstly, it retrieves the rating session and re-rate the reservation item
to compute a first rating result used by the client application
to cancel the previous balance reservation.
The transactions from this rating result are provided to the TIF.
Secondly, it consolidates a chargeable
item for confirmation using both the reservation one from the rating session and
the confirmation one if present. This chargeable item is rated and
previously reserved counters are committed into the database.
A second rating result is then available for the client application to
confirm the balance reservation. The transactions from this
rating result are also provided to the TIF.
This method manages also the session cancellation case
by setting the resolution parameter to CANCELLED.
It retrieves the rating session first and cancels the
related counter reservations coming from either a
previous session start or a session update.
The rating result that is returned is empty in case of cancellation.
Finally, the rating session is removed and the session identifier
becomes available for next sessions.
confirmationItem - the confirmation item (optional, null value is accepted)sessionID - the session identifier previously usedserviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceresolution - the resolution of the rating session (CANCELLED or
CONFIRMED)resultType - the rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)cleanupResultType - the session cleanup rating result type to be returned (NONE_TRANSACTION,
MASTER_TRANSACTION, ALL_TRANSACTION or
ALL_TRANSACTION_AND_RECURRING)ft - sets if the returned transactions must be filtered according to the transactionTemplate
StopRateResult
ForbiddenChargeException - when the rating is not allowed
InvalidItemException - when the chargeable item is invalid
StopRateException - when rating session cannot be stopped
TransactionClearingException - when transactions cannot be cleared
ServerFailureException - when the rater instance cannot handle the request
CommunicationFailureException - when the rater instance cannot be reached
public ISessionStartChargingOperation createSessionStartOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
method allows you to create a start operation to manage the service consumption by an end customer.
In a session-based charging scenario, a customer is charged for the consumptions of different service options (voice, text, data) defined in a service bundle.
For each service option, you manage a charging session that is a sequence of reservations and reservation confirmations.
You manage a customer session that relates to the activity of an end customer. This session includes several charging sessions, each charging session
is identified by a unique reservation ID. Once a charging session is ended, you can reuse its ID.
The interface returned by this method allows defining several reservations through multiple calls to
prepareReserve(..).
You define a reservation for each service option that is consumed by the end customer.
When all the reservations are prepared, a call to execute() method sends the request to the connected SAP CC system.
This operation charges each reservation (represented as a chargeable item) and creates the related reservations on counters and balances.
For each of these reservations a persistent charging session is created and a rating result is returned.
This return can be used to reserve the balance.
Note
This operation should be executed only once.
It must not be reused for future calls.
sessionID - The session identifier that has to be uniqueserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the service was consumed by the end customer (this date is used as a consumption date for reservations)
public ISessionUpdateChargingOperation createSessionUpdateOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
method allows you to create an update operation to
process an update event of a multiservice session-based charging sequence.
The interface returned by this method allows managing several pending reservations and associated reservation cycles and charging sessions:
prepareReserve(..)prepareConfirm(..)prepareCancel(..)prepareConfirmAndReserve(..)execute() method sends the request to the connected SAP CC system.
operation charges each reservation (represented as chargeable item) and creates the related reservations on counters and balances.
It extends a reservation by charging a partial or total confirmation of a previous reservation and updates the related reservations on counters and balances for the new reservation.
And finally it confirms (partially or totally) a previous reservation. Alternatively it is able to cancel the reservation.
For each of the new reservations a persistent charging session is created and a rating result is returned. This return can be used to reserve the balance.
If the charging session already exists, it is updated with the new reservation.
Note
This operation should be executed each time
customer events or reservation extension cycles apply.
sessionID - The session identifier which has to be uniqueserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date the marketable service was consumed by the end customer (this date is used as a consumption date for new reservations)
public ISessionStopChargingOperation createSessionStopOperation(java.lang.String sessionID,
java.lang.String userServiceID,
java.lang.String serviceID,
java.util.Date consumptionDate)
stop operation confirms (partially or totally) previous reservations and is able to cancel some other reservations.
This method creates a stop operation to process a termination event of a multiservice session-based charging sequence.
The interface returned by this method allows finalizing pending reservations:
prepareConfirm(..)prepareCancel(..)
When all the reservation confirmations and reservation cancellations are prepared,
a call to the execute() method sends the request to the connected SAP CC system.
Notes
executed only once.
It must not be reused for future calls.
prepareReserve(..) and prepareConfirmAndReserve(..) methods are not available.
sessionID - The session identifier which has to be uniqueserviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provideruserServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceconsumptionDate - The date when the session stops
public IMonitorSpendingStatusResultListener.ISpendingStatusMonitoringResult monitorSpendingStatus(java.lang.String monitoringId,
byte ssrlId,
java.lang.String userServiceId,
java.lang.String[] spendingStatusIds,
int ttl)
throws java.lang.IllegalArgumentException,
ForbiddenChargeException,
ServerFailureException,
CommunicationFailureException
userServiceId.
monitoringId.
null: To cancel the monitoringPrerequisite
Your monitoring client must implement
a spending status report listener in charge of receiving and
processing the spending status changes. Monitoring results are returned to the implementation of the
IMonitorSpendingStatusResultListener.
Note
You can create, update, and cancel a spending status monitoring. You can monitor several times the same end customer.
monitoringId - The identifier of the spending status monitoringssrlId - The identifier of the SpendingStausReportListener (accepted values: 1 to 127)userServiceId - The user service identifier (USID): A technical identifier of the end customerspendingStatusIds - Identifying the set of spending status to monitorttl - The time to live given in seconds
operation result which contains the performed operation and
the current label value for each monitored spending status
java.lang.IllegalArgumentException - null or emptynull or emptyForbiddenChargeException - when the access is not found
ServerFailureException - if the server is not available
CommunicationFailureException - when a communication failure occurspublic 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 | ||||||||