Class StatefulServiceClient
- All Implemented Interfaces:
com.highdeal.barbus.ISSLContextProvider
- Direct Known Subclasses:
ChargeableItemCollectorClient
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:
- Synchronous Services and Operations
- Features
- Implementation in Your Client Application
- Notes on SAP CC Implementation
Synchronous Services and Operations
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
- Consult all the online charging services that you can implement in your Java-based client application.
- Refer to the
AsyncStatefulServiceClient classfor asynchronous communications and very-high throughput performances.
Deprecated Services and Operations
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.
Features
This charging client benefits
from the functions provided by the Message TCP technical interface.
Refer to its features about:
- High Availability Management
- High Volume Management
- High Performance Management
Operation Results
The connected SAP CC system replies to operation requests with the following data:
Charging Contract Operational Status
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.
Communication Timeout
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 Application Help for more information).
High Performances
By default, this charging client provides high throughput performances.
For very high throughput performances, consider the AsyncStatefulServiceClient or the fine-tuning activity.
High Availability (HA)
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.
Notification
You can implement the handling of the notifications sent by the SAP CC Core Server system:
- Asynchronous service for batch management: The notifications are regularly sent by the SAP CC system. Refer to the Java package information.
-
Synchronous service for real-time management: The notifications are embedded by the SAP CC system in the
result messagesof 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.
Security
To implement a ciphered connection between the client and SAP CC, use AsyncRatingServiceClient.setSslContext(javax.net.ssl.SSLContext).
Then, the client application will be authenticated and authorized to connect to the SAP CC server by calling the
AsyncRatingServiceClient.connect(String hostname, int port, boolean secure, String bindAddress, int timeout, FoundLostRatingListener ratingListener, ServiceClientTuning config)
method, with secure parameter set to true.
To implement user authentication between the client and SAP CC, the client must set up some valid user credentials by calling the setUserCredentials() method.
Then, the client application will be authenticated and authorized to connect to the SAP CC server by calling one of the following connect() methods:
AsyncRatingServiceClient.connect(com.highdeal.admin.hci.InstanceMap, String, int, FoundLostRatingListener, ServiceClientTuning)AsyncRatingServiceClient.connect(String, java.net.InetSocketAddress...)AsyncRatingServiceClient.connect(String, com.highdeal.barbus.InstanceAddress...)AsyncRatingServiceClient.connect(String, int)AsyncRatingServiceClient.connect(String, int, boolean, String, int, FoundLostRatingListener, ServiceClientTuning)AsyncRatingServiceClient.connect(String, int, FoundLostRatingListener)AsyncRatingServiceClient.connect(String, int, java.net.InetSocketAddress, String, int, FoundLostRatingListener, ServiceClientTuning, java.net.InetSocketAddress...)AsyncRatingServiceClient.connect(String, int, java.net.InetSocketAddress, String, int, FoundLostRatingListener, ServiceClientTuning, com.highdeal.barbus.InstanceAddress...)AsyncRatingServiceClient.connect(String, int, int)AsyncRatingServiceClient.connect(String, int, String, int, FoundLostRatingListener)AsyncRatingServiceClient.connect(String, int, String, int, FoundLostRatingListener, ServiceClientTuning)
Code Snippet
The following code snippet provides an example of how to authenticate a client application to the SAP CC server :
private static final String DISPATCHER_HOST = "localhost";
private static final int DISPATCHER_EXT_PORT = 2000;
// Initialize the stateful service client by (always) calling the empty builder (other builders are deprecated)
StatefulServiceClient client = new StatefulServiceClient();
// Set the user credentials for the new created client
// These credentials must refer to an existing service user in SAP CC that has the "messageChargingClient" role.
client.setUserCredentials("clientX", "foopasswd");
//Call one of the connect() methods that are provided in Service Client classes according to the
// expected behavior.
ConnectionStatus status = client.connect(DISPATCHER_HOST, DISPATCHER_EXT_PORT);
// Check the result of the connect() method.
if (!status.isServiceAvailable()) { // No dispatcher can be reached
} // else at least one CC dispatcher has been reached and charging is available
Implementation in Your Client Application
Initializing and Connecting
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.
Implementing Session-Based Charging Services
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.
System Configuration
Consult the SAP CC Configuration and Implementation Guide to know the necessary configuration settings of the SAP CC system.
Master Data Configuration
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 Application Help and the primary help of the SAP CC Core Tool user interface for more information.
Implementing Event-Based Charging Services
Depending on your business requirements, you implement one of the following operations in your Java-based client application:
Implementing Policy Control Services
You implement this function to provide policy control mechanisms in your system landscape.
Prerequisites
The SAP CC system is configured to support the reservation renewal function.
Customizing Sequence
Dedicated Listener
System Configuration
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.
Terminating
Your client application must release the connections when it ends.
Implement the <a href="StatefulServiceClient.html#close()"close(..) method.
Advanced Implementation
The following advanced implementation activities are possible. Refer to the implementation note section for more information.
- Reservation renewal function (in the session-based charging services)
- Spending status monitoring function
- Fine-tuning
Notes on SAP CC Implementation
Fine-Tuning
By default, this charging client provides high throughput performances.
You can fine tune the behavior of your client application by implementing the
StatefulServiceClientTuning class.
Implementing the Spending Status Monitoring Function
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.
Prerequisites
The SAP CC system is configured to support the spending status monitoring function.
Customizing Sequence
- Depending on your business requirements, design your listener of spending status reports accordingly to the spending status changes sent by the SAP CC system
-
Implement the integration code of a spending status report listener based on the
ISpendingStatusReportListenerinterface. Develop your ownonSpendingStatusReport(...)method - Depending on your business requirements, design your client application accordingly to your own spending status monitoring sequences
-
In your client application, implement a monitoring client based on this
StatefulServiceClientclass:-
Register your own spending status report listener implementation with the
registerSpendingStatusReportListener(...)method -
Manage the relevant spending status monitoring sequences with the
monitorSpendingStatus(...)method. This method enables you to create, change or cancel a spending status monitoring. -
Finally, unregister your spending status report listener with the
unregisterSpendingStatusReportListener(...)method
-
Register your own spending status report listener implementation with the
System Configuration
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.
Implementing the ISpendingStatusReportListener interface
A client application must implement the ISpendingStatusReportListener interface to be able to handle monitoring reports.
Implementing the Reservation Renewal Function
This function is available in the session-based charging services.
Prerequisites
The SAP CC system is configured to support the reservation renewal function.
Customizing Sequence
- Depending on your business requirements, design the functions of the listeners of renew reservation notifications
- Implement the integration code of a reservation renewal listener based on the
IReservationRenewalListenerinterface. You develop your ownonRenewReservation(..) method. -
Extend the initialization of the charging client:
Implement the
registration of a listenerwith theregisterReservationRenewalListener(..) method. -
Otherwise, you can implement another client based on the
StatefulServiceClientclassin the client application or in another client application. This newnotification clientis responsible for handling all the renew reservation notifications for all the charging client instances in the client application. - Change the implementation of the multiservice session-based charging services
- In the
Multiservice session start:-
Enable the reservation renewal function when starting a multiservice session by using the
setReservationRenewalListenerId(..) inherited method. Specify that the multiservice sessions are eligible for renew reservation notifications by the reservation renewal listener identified by the specified identifier. -
When relevant for your business requirements, set up external data that the reservation renewal listener(s) may need when processing the renew reservation notifications.
Use the
setExternalData(..) inherited method. This data is never changed by the SAP CC Core Server system.
-
Enable the reservation renewal function when starting a multiservice session by using the
- In the
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.
- In the
- Change the termination of the charging client: Implement the unregistration of a listener
System Configuration
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.
Implementing the 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:
- The session identifier, which is unique to the multiservice charging session
- The reservation identifier, which is unique to the service charging session for the multiservice charging session
- The external data that can optionally be passed to the SAP CC system during a start or update operation
- An index indicating the number of attempts to transmit this notification
- An
IReservationRenewalAcknowledgerobject 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");
}
});
}
}
Implementing the 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);
Implementing the 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);
Changing the Implementation of the Session-Based Charging APIs
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:
- Specify that the session is monitored for renew reservation notifications by the reservation renewal listener identified by the given identifier. The method
setReservationRenewalListenerId()of the operation should be used. - Optionally, add external data that the reservation renewal listener may need when processing the notification. The method
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:
- Optionally, add external data that the reservation renewal listener may need when processing the notification. The method
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:
- No additional action is necessary
Additional Information
Consult all the online and offline charging services that you can implement in your Java-based client application.
Consult the SAP CC Application Help for more information about the online charging services, the charging process and its execution modes.
-
Field Summary
Fields inherited from class com.highdeal.cnd.message.AsyncRatingServiceClient
ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING, CANCELLED, CHARGING_RESULT_MSG, CHARGING_RESULT_REST, CHARGING_RESULT_WS, CONFIRMED, MASTER_TRANSACTION, NONE_TRANSACTION -
Constructor Summary
ConstructorsConstructorDescriptionCreates a non-initializedcharging client; Use one of theconnect(..) methodsto connect this client to the distant SAP CC Core Server system.StatefulServiceClient(String hostName, int port) Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection.StatefulServiceClient(String hostName, int port, int timeout) Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection.StatefulServiceClient(String hostName, int port, FoundLostRatingListener ratingListener) Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection.StatefulServiceClient(String hostName, int port, String bindAddress, int timeout, FoundLostRatingListener ratingListener) Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection. -
Method Summary
Modifier and TypeMethodDescriptionactivate(String subscriberAccountCode, String serviceProvider, int resultType, boolean ft, Date toDate) Consider the mainactivate operationfor more information.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 andsubscriptionsrelating to the specifiedsubscriber account; You use this operation to prepare the invoicing and billing operations in an external system.blankCharge(ChargeableItem ci, String serviceID, String userServiceID, 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.blankCharge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) Consider themain blank charge operationfor more information; You can specify if the returnedtransactionsmust be filtered according to thetransactionTemplate.blankCharge(ChargeableItem ci, String serviceID, String userServiceID, 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.charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate) This main business operation requests the SAP CC system to charge thespecified chargeable itemfor the specified user service ID and the specified service ID at the specified date without transaction selection.charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts) Consider the maincharge operationcharge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date)charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) Consider the maincharge operationcharge(com.highdeal.pnr.hci.ChargeableItem, java.lang.String, java.lang.String, java.util.Date)charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, ChargeExecutionContext context) This main business operation requests the SAP CC system to charge thespecified chargeable itemfor the specified user service ID and service ID at the specified date.checkLimit(ChargeableItem item, String serviceID, String userServiceID, Date consumptionDate, String propertyName, BigDecimal precision, Money limitAmount, boolean estimationMode) This main business operation requests either an inverse rating operation or a best-effort charging operation.checkLimit(ChargeableItem item, String serviceID, String userServiceID, Date consumptionDate, String propertyName, BigDecimal precision, Money limit, boolean estimationMode, int ts, boolean ft) Consider the maincheckLimit(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 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.cleanup(String subscriberAccountCode, String serviceProvider, Date toDate, int resultType, boolean ft) Consider the maincleanup operationfor more information.createSessionStartOperation(String sessionID, String userServiceID, String serviceID, Date consumptionDate) Thismethodallows you to create astart operationto manage the service consumption by an end customer.createSessionStopOperation(String sessionID, String userServiceID, String serviceID, Date consumptionDate) Thisstop operationconfirms (partially or totally) previous reservations and is able to cancel some other reservations.createSessionUpdateOperation(String sessionID, String userServiceID, String serviceID, Date consumptionDate) Thismethodallows you to create anupdate operationto process an update event of a multiservice session-based charging sequence.getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, 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).getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts) Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation Consider the mainget estimated price operationfor more information.getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation Consider the mainget estimated price operationfor more information.monitorSpendingStatus(String monitoringId, byte ssrlId, String userServiceId, String[] spendingStatusIds, int ttl) Manages the monitoring of spending statuses concerning the charging contract that relates to the specifieduserServiceId.postRate(long reservationUID, String serviceID, 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.postRate(long reservationUID, String serviceID, 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.preRate(ChargeableItem ci, String serviceID, String userServiceID, 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.preRate(ChargeableItem ci, String serviceID, String userServiceID, 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 mainprerate operationfor more information.startRate(ChargeableItem reservationItem, String sessionID, Date consumptionDate, String serviceID, 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.startRate(ChargeableItem reservationItem, String sessionID, Date consumptionDate, String serviceID, String userServiceID, int defaultResolution, long ttl, int resultType, int cleanupResultType, boolean ft, String propertyToInverse) Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging servicesstopRate(ChargeableItem confirmationItem, String sessionID, String serviceID, 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.stopRate(ChargeableItem confirmationItem, String sessionID, String serviceID, 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 servicesObject[]Translates some values by using a translation tableObject[]Translates some values by using a translation tableupdateRate(ChargeableItem confirmationItem, ChargeableItem reservationItem, String sessionID, Date consumptionDate, String serviceID, 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.updateRate(ChargeableItem confirmationItem, ChargeableItem reservationItem, String sessionID, Date consumptionDate, String serviceID, 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 servicesMethods inherited from class com.highdeal.cnd.message.AsyncStatefulServiceClient
activate, blankCharge, blankCharge, blankCharge, charge, charge, charge, charge, checkLimit, checkLimit, cleanup, createSessionStartAsyncOperation, createSessionStopAsyncOperation, createSessionUpdateAsyncOperation, getEstimatedPrice, getEstimatedPrice, getEstimatedPrice, monitorSpendingStatus, postRate, postRate, preRate, preRate, registerReservationRenewalListener, registerSpendingStatusReportListener, startRate, startRate, startRate, stopRate, stopRate, stopRate, translate, translate, unregisterReservationRenewalListener, unregisterSpendingStatusReportListener, updateRate, updateRate, updateRateMethods inherited from class com.highdeal.cnd.message.AsyncRatingServiceClient
addAuthenticationListener, close, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getBootMode, getClientOpEventListener, getConnectionStatus, getSslContext, getTimeout, isAtLeastOneConnectionIsRegistered, isConnected, isNoTimeout, setBootMode, setClientOpEventListener, setHAEventListener, setNoTimeout, setSslContext, setUserCredentials, setUserCredentials
-
Constructor Details
-
StatefulServiceClient
public StatefulServiceClient()Creates a non-initializedcharging client; Use one of theconnect(..) methodsto connect this client to the distant SAP CC Core Server system. -
StatefulServiceClient
Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection. Creates acharging clientand connects it to the distant SAP CC Core Server system- Parameters:
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- Throws:
IOException- if the client cannot connect to the SAP CC system.
-
StatefulServiceClient
Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection. Creates acharging clientand connects it to the distant SAP CC Core Server system; A client timeout is specified for the communications.- Parameters:
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-1to wait indefinitely) If you use zero and acknowledgments are requested then aCommunicationFailureExceptionwill be thrown without sending request.- Throws:
IOException- if the client cannot connect to the SAP CC system (if the server system is not running, for instance)
-
StatefulServiceClient
@Deprecated public StatefulServiceClient(String hostName, int port, FoundLostRatingListener ratingListener) throws IOException Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection. Initializes acharging clientand connects it to the distant SAP CC Core Server system;- Parameters:
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- Throws:
IOException- if the client cannot connect to the SAP CC system
-
StatefulServiceClient
@Deprecated public StatefulServiceClient(String hostName, int port, String bindAddress, int timeout, FoundLostRatingListener ratingListener) throws IOException Deprecated.Deprecated since version 4.1 SP2 of SAP CC and replaced by the empty builder and an authenticated connection. Initializes acharging clientand 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.- Parameters:
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 aCommunicationFailureExceptionwill be thrown without sending request.ratingListener- The listener informed when rating is found or lost- Throws:
IOException- if the client cannot connect to the SAP CC system
-
-
Method Details
-
charge
public PurchaseOrder charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException Consider the maincharge operationcharge(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.
- Parameters:
ci- TheChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRINGft- Flag to specify if the returned transactions must be filtered according to thetransactionTemplate- Returns:
- The transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
charge
public PurchaseOrder charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException Consider the maincharge operationcharge(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.
- Parameters:
ci- theChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRING- Returns:
- the transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
charge
public PurchaseOrder charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException This main business operation requests the SAP CC system to charge the
specified chargeable itemfor 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.
- Parameters:
ci- thechargeable itemto 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- Returns:
- The
purchase orderresulting from the charging process - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
charge
public ChargingResult charge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, ChargeExecutionContext context) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException This main business operation requests the SAP CC system to charge the
specified chargeable itemfor 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.
- Parameters:
ci- Thechargeable itemto 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- Thecontextin which the operation is executed- Returns:
- The
resultof the charging operation - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
blankCharge
public PurchaseOrder blankCharge(ChargeableItem ci, String serviceID, String userServiceID, 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 operationbut 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.
- Parameters:
ci- thechargeable itemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRING- Returns:
- The transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
blankCharge
public PurchaseOrder blankCharge(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException Consider themain blank charge operationfor more information; You can specify if the returnedtransactionsmust be filtered according to thetransactionTemplate.- Parameters:
ci- theChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRINGft- Flag to specify if the returned transactions must be filtered according to thetransactionTemplate- Returns:
- The transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
blankCharge
public ChargingResult blankCharge(ChargeableItem ci, String serviceID, String userServiceID, 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 operationbut 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.
- Parameters:
ci- Thechargeable itemto 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- Thecontextin which the operation is executed- Returns:
- The
resultof the charging operation - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
getEstimatedPrice
@Deprecated public PurchaseOrder getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate) throws ForbiddenChargeException, InvalidItemException, ServerFailureException, CommunicationFailureException Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the blank charging operationThis 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.
- Parameters:
ci- Thechargeable itemto 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- Returns:
- The transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
getEstimatedPrice
@Deprecated public PurchaseOrder getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts) throws ForbiddenChargeException, InvalidItemException, ServerFailureException, CommunicationFailureException Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the blank charging operationConsider the mainget estimated price operationfor 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.- Parameters:
ci- theChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRING- Returns:
- the transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
getEstimatedPrice
@Deprecated public PurchaseOrder getEstimatedPrice(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int ts, boolean ft) throws ForbiddenChargeException, InvalidItemException, ServerFailureException, CommunicationFailureException Deprecated.Deprecated since version 4.0 of SAP CC and replaced by the blank charging operationConsider the mainget estimated price operationfor 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.- Parameters:
ci- TheChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRINGft- Sets if the returned transactions must be filtered according to thetransactionTemplate- Returns:
- the transaction's
PurchaseOrder - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
checkLimit
public CheckLimitResult checkLimit(ChargeableItem item, String serviceID, String userServiceID, Date consumptionDate, String propertyName, BigDecimal precision, Money limitAmount, boolean estimationMode) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, CannotInverseException, ServerFailureException, CommunicationFailureException This main business operation requests either an inverse rating operation or a best-effort charging operation.- The inverse rating operation determines the maximum quantity of a customer service that an end customer can consume based on a limit amount specified in the operation request. The inverse charging operation only checks this limit. This is an estimate.
- The best-effort charging operation checks first this limit and charges the end customer for that price even if the customer does not totally use the service.
The chargeable item that is specified must contain a value for the
propertyto inverse. This value represents the maximum value return for the property to inverse. The value must be valid regarding theprecisionspecified. 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 operationby specifying the estimation mode to false (seeestimationMode). 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 (
nullvalue), 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.
- Parameters:
item- Thechargeable itemto 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 ornull)estimationMode- the estimation mode (falsefor a best-effort charging operation;truefor an inverse rating operation)- Returns:
- The maximum quantity of service an end customer can consume based on a limit amount
- Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursCannotInverseException- if the inverse rating cannot be performedServerFailureException- if the SAP CC system is not availableCommunicationFailureException- if a communication failure occurs
-
checkLimit
public CheckLimitResult checkLimit(ChargeableItem item, String serviceID, String userServiceID, Date consumptionDate, String propertyName, BigDecimal precision, Money limit, boolean estimationMode, int ts, boolean ft) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, CannotInverseException, ServerFailureException, CommunicationFailureException Consider the maincheckLimit(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.- Parameters:
item- theChargeableItemto 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 selectionNONE_TRANSACTION,MASTER_TRANSACTION,ALL_TRANSACTION,ALL_TRANSACTION_AND_RECURRINGft- sets if the returned transactions must be filtered according to thetransactionTemplate- Returns:
- the check limit result
- Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursCannotInverseException- if the check limit cannot be performedServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
preRate
@Deprecated public PreRateResult preRate(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int resultType, long reservationUID, int defaultResolution, long ttl) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, PreRateException, ServerFailureException, CommunicationFailureException Deprecated.Deprecated since version 2.0 of SAP CC and replaced by the session-based charging services Consider the mainprerate operationfor 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.- Parameters:
ci- theChargeableItemto 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 (seePreRateOpfor the constants)reservationUID- the reservationUID used later to post-ratedefaultResolution- the default resolution to be used at expiration (seePreRateOp}for the constants)ttl- the time to live given in seconds- Returns:
- The computed
PreRateResult - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursPreRateException- if a prerating error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
preRate
@Deprecated public PreRateResult preRate(ChargeableItem ci, String serviceID, String userServiceID, Date consumptionDate, int resultType, boolean ft, long reservationUID, int defaultResolution, long ttl) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, PreRateException, ServerFailureException, CommunicationFailureException 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.- Parameters:
ci- theChargeableItemto 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 (seePreRateOpfor the constants)ft- sets if the returned transactions must be filtered according to thetransactionTemplatereservationUID- the reservationUID used later to post-ratedefaultResolution- the default resolution to be used at expiration (seePreRateOp}for the constants)ttl- the time to live given in seconds- Returns:
- the computed
PreRateResult - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursPreRateException- if a prerating error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
postRate
@Deprecated public PostRateResult postRate(long reservationUID, String serviceID, String userServiceID, int resolution, int resultType, ChargeableItem newCi) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, PostRateException, ServerFailureException, CommunicationFailureException 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 newChargeableItemmay be passed.
Not likePostRateOp, there areserviceIDanduserServiceIDparameters. They have no functional meaning and are not mandatory, but setting them with same value as forpreRatemay increase the performance in multi-server configuration.- Parameters:
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 (seePostRateOpfor the constants)resultType- the result type (seePostRateOpfor the constants)newCi- the newChargeableItemto be used for this post-rating- Returns:
- The computed
PostRateResult - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursPostRateException- if a prerating error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
postRate
@Deprecated public PostRateResult postRate(long reservationUID, String serviceID, String userServiceID, int resolution, int resultType, boolean ft, ChargeableItem newCi) throws InvalidItemException, ForbiddenChargeException, TransactionClearingException, PostRateException, ServerFailureException, CommunicationFailureException 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 newChargeableItemmay be passed.
Not likePostRateOp, there areserviceIDanduserServiceIDparameters. They have no functional meaning and are not mandatory, but setting them with same value as forpreRatemay increase the performance in multi-server configuration.- Parameters:
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 (seePostRateOpfor the constants)resultType- the result type (seePostRateOpfor the constants)ft- sets if the returned transactions must be filtered according to thetransactionTemplatenewCi- the newChargeableItemto be used for this post-rating- Returns:
- The computed
PostRateResult - Throws:
InvalidItemException- if the chargeable item is not validForbiddenChargeException- if charging is forbiddenTransactionClearingException- if a transaction clearing error occursPostRateException- if a prerating error occursServerFailureException- if the server is not availableCommunicationFailureException- if a communication failure occurs
-
activate
public PurchaseOrder activate(String subscriberAccountCode, String serviceProvider, int resultType, Date toDate) throws ForbiddenChargeException, ActivateException, TransactionClearingException, ServerFailureException, CommunicationFailureException 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 andsubscriptionsrelating to the specifiedsubscriber account; You use this operation to prepare the invoicing and billing operations in an external system. The operation returns therelated purchase order.- Parameters:
subscriberAccountCode- The identification code of thesubscriber accountrepresenting an end customer of a service providerserviceProvider- The identification code of the service provider, owner of both thepricing catalogsand 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 -)- Returns:
- The
related purchase orderthat 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. - Throws:
ForbiddenChargeException- if the SAP CC system cannot retrieve the contract (or subscription) or if a parameter is malformedActivateException- if the contract (or subscription) cannot be activated for several reasons (seeActivateExceptionfor more information)TransactionClearingException- if the Transaction Processor plugged, is not able to clear at least one of the generated transactionsServerFailureException- if the targeted rater instance (of the SAP CC system) is not ready to treat the activation requestCommunicationFailureException- if the targeted rater instance cannot be reached by the Packets over TCP communication layer
-
activate
public PurchaseOrder activate(String subscriberAccountCode, String serviceProvider, int resultType, boolean ft, Date toDate) throws ForbiddenChargeException, ActivateException, TransactionClearingException, ServerFailureException, CommunicationFailureException Consider the mainactivate operationfor 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.- Parameters:
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 thetransactionTemplatetoDate- 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 -)- Returns:
- The related purchase order which will contain the list of generated transactions (if required and if some transactions exist)- one shot and recurring ones -. However, the purchase order will contain the total of generated amounts and the state of the purchase.
- Throws:
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 (ActivateExceptionfor more info about reasons).TransactionClearingException- if the Transaction Processor plugged, is not able to clear at least one of the generated transactionsServerFailureException- if the targeted rater instance is not ready to treat the activation requestCommunicationFailureException- if the targeted rater instance cannot be reached by the Packets over TCP communication layer
-
cleanup
public CleanupResult cleanup(String subscriberAccountCode, String serviceProvider, Date toDate, int resultType) throws ForbiddenChargeException, TransactionClearingException, ServerFailureException, CommunicationFailureException, CleanupException 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.See alsoMore precisely, the SAP CC system executes the post-rating process for the expired records, using their default resolution (passed into the
PreRateOp).
As for thepostRate, 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 (seetoDate) that is used by the SAP CC system to determine whether a rating record is expired or not. <div class="noteDiv>Note
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
-