com.highdeal.cnd.message
Class AsyncStatefulServiceClient

java.lang.Object
  extended by com.highdeal.cnd.message.AsyncStatefulServiceClient
All Implemented Interfaces:
com.highdeal.barbus.ISSLContextProvider
Direct Known Subclasses:
StatefulServiceClient

public class AsyncStatefulServiceClient
extends java.lang.Object

This main Java class provides the operations necessary to implement real-time charging services (event-based or session-based) in your SAP system landscape by using the Message TCP technical interface with asynchronous communications for the highest 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

This is the preferred charging client to leverage for using SAP Convergent Charging as a stateful Online Charging System (OCS). It provides the most configuration flexibility as well as the best throughput performances.

Consider the following information in this topic:

Note

The protected methods are included and displayed in this product documentation. They are not available for your implementation if you use this class.

Asynchronous 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:
  • A multiservice session includes several charging sessions
  • Optional reservation renewal mechanism associated to a specialized listener
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 specialized listener. This listener must register to the connected SAP CC system.

Business monitoring Spending status monitoring (advanced implementation) You manage the spending status monitoring by
Billing process synchronization Activation of periodic and one-off fees activate(..)

Special:

Notes

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.

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:
  • Start a charging session by reserving credit
  • Update the session by confirming or cancelling the previous reservation (effective charging) and operating a new reservation
  • Stop the session
Replaced by the multiservice session-based charging service

Features

This charging client benefits from the functions provided by the Message TCP technical interface. Refer to its features about:

Event Listener

Most of the operation requests are asynchronous and expect an event listener for processing their results or exceptions. These listeners are invoked when the operation is successful with the result of the operation or when it fails with an exception defining the problem.

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

Depending on the nature of the charging workflow, the recommended timeout may vary greatly. Consider your business requirements.

Note

For event-based charging, no timeout is recommended.

High Performances

By default, this charging client provides high throughput performances.

- maxQueueSizeToWait

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:

Security

Use setSslContext(javax.net.ssl.SSLContext )

Implementation in Your Client Application

Event Listener

Most of the operation requests are asynchronous and expect an event listener for processing their results or exceptions. These listeners are invoked when the operation is successful with the result of the operation or when it fails with an exception defining the problem.

Initializing and Connecting

Your charging client (based on this AsyncStatefulServiceClient 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.

Code Snippet

The following code snippet provides an example of how to initialize a charging client based on the AsyncStatefulServiceClient class:

     AsyncStatefulServiceClient client = new AsyncStatefulServiceClient();
     try {
         client.connect("dispatcher.hostname", 2000);
     } catch (IOException e) {
         System.out.println("Dispatcher instance not found. Reason is: "+e.getMessage());
         return;
     }
 

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 Library (Application Help) documentation and the SAP CC Core Tool online Help 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:

Terminating

Your client application must release the connections when it ends. Implement the close() method.

Recommendation

Do not forget to close this charging client when it is no more used to release its resources and nested threads invoking its close() method.

Advanced Implementation

The following advanced implementation activities are possible. Refer to the implementation note section for more information.

Notes on SAP CC Implementation

Fine-Tuning

By default, this charging client provides very high throughput performances.

You can fine tune the behavior of your client application by implementing the AsyncStatefulServiceClientCtrl 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
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
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 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 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
    AsyncStatefulServiceClient client = new AsyncStatefulServiceClient(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
    AsyncStatefulServiceClient client = new AsyncStatefulServiceClient(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:

Code Snippet

    // Create a multiservice charging session start operation
    ISessionStartChargingAsyncOperation startOp = client.createSessionStartAsyncOperation(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:

Code Snippet

    // Create a multiservice charging session update operation
    ISessionUpdateChargingAsyncOperation updateOp = client.createSessionUpdateAsyncOperation(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:

Additional Information

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.

Related Information

See Also:
ActivateEventListener, ChargeEventListener, ChargingResultListener, CleanupEventListener, CheckLimitEventListener, PrePostRateEventListener, SessionEventListener, TranslateEventListener

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
AsyncStatefulServiceClient()
          Use one of the connect(..) methods to connect this client to the distant SAP CC system.
AsyncStatefulServiceClient(java.lang.String hostName, int port)
          Creates a charging client and connects it to the distant SAP CC Core Server system
AsyncStatefulServiceClient(java.lang.String hostName, int port, FoundLostRatingListener ratingListener)
          Initializes a charging client and connects it to the distant SAP CC Core Server system;
AsyncStatefulServiceClient(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.
AsyncStatefulServiceClient(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;
 
Method Summary
 void activate(java.lang.String subscriberAccountCode, java.lang.String serviceProvider, int resultType, boolean ft, java.util.Date toDate, ActivateEventListener listener)
          This main operation triggers the activation of all the periodic and one-off fees (see recurring rates and one-shot rates in the 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.
 void blankCharge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, ChargeExecutionContext context, ChargingResultListener listener)
           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.
 void blankCharge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, boolean ft, ChargeEventListener listener)
          Consider the main blank charge operation in this class.
 void blankCharge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, ChargeEventListener listener)
           This main business operation requests the connected SAP CC system to charge in blank execution mode the specified chargeable item for the specified user service ID and service ID at the specified date.
 void charge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, ChargeEventListener listener)
           This main business operation requests the connected SAP CC system to rate and charge the specified chargeable item for the specified customer service and for the specified user service ID (technical ID of the end user in this customer server) at the specified date.
 void charge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, ChargeExecutionContext context, ChargingResultListener listener)
           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.
 void charge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, boolean ft, ChargeEventListener listener)
          Consider the main charge operation in this class.
 void charge(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, ChargeEventListener listener)
          Consider the main charge operation in this class.
protected  boolean checkDB(short partitionID)
          FOR INTERNAL USE ONLY - This method is for internal use only.
 void checkLimit(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, java.lang.String propertyName, java.math.BigDecimal precision, Money limitAmount, boolean estimationMode, CheckLimitEventListener listener)
          This main business operation requests either an inverse rating operation or a best-effort charging operation.
 void checkLimit(ChargeableItem ci, 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, CheckLimitEventListener listener)
           Consider the main check limit operation.
 void cleanup(java.lang.String subscriberAccountCode, java.lang.String serviceProvider, java.util.Date toDate, int resultType, boolean ft, CleanupEventListener listener)
          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.
 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.
 ISessionStartChargingAsyncOperation createSessionStartAsyncOperation(java.lang.String sessionID, java.lang.String userServiceID, java.lang.String serviceID, java.util.Date consumptionDate)
          This method creates a start operation in order to process an initial event of a session-based charging scenario.
The interface returned by this method allows defining several reservations through multiple calls to prepareReserve.
 ISessionStopChargingAsyncOperation createSessionStopAsyncOperation(java.lang.String sessionID, java.lang.String userServiceID, java.lang.String serviceID, java.util.Date consumptionDate)
          This method creates a stop operation in order to process a termination event of a session-based charging scenario.
This operation can manage several: confirmations through calls to prepareConfirm cancellations through calls to prepareCancel When all the confirmations and cancellations are prepared, a call to execute sends the request.
This operation confirms (partially or totally) a previous reservation.
 ISessionUpdateChargingAsyncOperation createSessionUpdateAsyncOperation(java.lang.String sessionID, java.lang.String userServiceID, java.lang.String serviceID, java.util.Date consumptionDate)
          This method creates an update operation in order to process an update event of a session-based charging scenario.
The interface returned by this method allows defining several: reservations through calls to prepareReserve confirmations through calls to prepareConfirm cancellations through calls to prepareCancel reservation extensions through calls to prepareConfirmAndReserve When all the reservations, confirmations, cancellations and reservation extensions are prepared, a call to execute sends the request.
This operation charges each reservation (represented as chargeable item) and creates the related reservations on counters and balances.
protected  int currentQueueSize(short partitionID)
          FOR INTERNAL USE ONLY - This method is for internal use only.
 BootMode getBootMode()
          Returns which API is used to retrieve from the remote instances, the Instance Map needed for the connection.
protected  com.highdeal.barbus.RoundRobinClient getClient()
          Deprecated. Deprecated since version 2.0 of SAP CC and should not be called anymore
 ClientOpEventListener getClientOpEventListener(ClientOpEventTopic topic)
          Gets the client operation event listener used by the client for the specified topic.
protected  java.lang.String getClusterName()
          Deprecated. Deprecated since version 2.0 of SAP CC Gets the system name.
protected  ServiceClientTuning getDefaultServiceClientTuning()
          Gets the default service tuning of this client useful to configure connections.
 void getEstimatedPrice(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, ChargeEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation This main business operation asks the connected SAP CC system to estimate the price relating to a service usage; The SAP CC system only processes the rating (dynamic pricing) of the service usage that is specified by a chargeable item, a user service ID, a service ID, and a consumption date. The accounting (account determination) is not processed.

Note

There is no impact to the customer mater data in the back-end database: The SAP CC system does not update the balances in subscriber account and the counters in contracts or subscriptions.

Recommendation

Refer to the description of the Java package for more information.

 void getEstimatedPrice(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, boolean ft, ChargeEventListener listener)
          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).
Asks the server to rate the specified chargeable item for the specified user service ID and service ID at the specified date without impacting the database.
 void getEstimatedPrice(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int ts, ChargeEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation Consider the main get estimated price operation in this class. 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 service ID at the specified date without impacting the database.
protected  com.highdeal.util.IEventListener getEventListenerFromListener(java.lang.Object listener)
           
protected  FoundLostRatingListener getFoundLostRatingListener()
          Returns the rating listener previously set.
protected  com.highdeal.barbus.Topic getRatingTopic()
          Gets the rating topic of this client used to send rating messages.
protected  com.highdeal.cnd.message.sensor.SensorsManager getSensorsManager()
           
 javax.net.ssl.SSLContext getSslContext()
          Returns the SSL context used with secure connections.
 int getTimeout()
          Returns the client communication timeout in milliseconds for each request (or -1 to wait indefinitely).
protected  com.highdeal.barbus.Topic[] getTopicsToSubscribe()
          Returns an array of topics that client must subscribe to.
protected  void handleSessionRequest(SessionChargingOperation op, ISessionResultListener listener)
           
 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.
 void monitorSpendingStatus(java.lang.String monitoringId, byte ssrlId, java.lang.String userServiceId, java.lang.String[] spendingStatusIds, int ttl, IMonitorSpendingStatusResultListener monitorSpendingStatusResultListener)
          Manages the monitoring of spending statuses that relate to an end customer (see userServiceId) during customer service charging and refilling operations
The spending status monitoring is identified by the monitoringId.
protected  void notifyHeartBeat(com.highdeal.barbus.Client client)
           
 void postRate(long reservationUID, java.lang.String serviceID, java.lang.String userServiceID, int resolution, int resultType, boolean ft, ChargeableItem newCi, PrePostRateEventListener listener)
          Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice 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.
 void postRate(long reservationUID, java.lang.String serviceID, java.lang.String userServiceID, int resolution, int resultType, ChargeableItem newCi, PrePostRateEventListener listener)
          Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice 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.
 void 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, PrePostRateEventListener listener)
          Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice session-based charging services Asks the server to pre-rate 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 used of the same reservation unique identifier for more than one pre-rating. This case is managed at post-rating time.
 void preRate(ChargeableItem ci, java.lang.String serviceID, java.lang.String userServiceID, java.util.Date consumptionDate, int resultType, long reservationUID, int defaultResolution, long ttl, PrePostRateEventListener listener)
          Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice session-based charging services Asks the server to pre-rate 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 used of the same reservation unique identifier for more than one pre-rating. This case is managed at post-rating time.
protected  void register(com.highdeal.hmi.IConnectable connectable)
           
 void registerReservationRenewalListener(byte rrlId, IReservationRenewalListener rrl)
          Registers a Reservation Renewal Listener (RRL) with its identifier.
 void registerSpendingStatusReportListener(byte ssrlId, ISpendingStatusReportListener ssrl)
          Registers a Spending Status Report Listener (SSRL) with its identifier.
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 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.

 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.
 void startRate(ChargeableItem ciToReserve, java.lang.String sessionID, java.util.Date consumptionDate, java.lang.String serviceID, java.lang.String userServiceID, int defaultResolution, long ttl, int resultType, boolean ft, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services Consider the main start rate operation for more information; You can specify if the resulting transactions must be filtered. This operation represents the start of a session-based charging.
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.
See also: updateRate and stopRate
 void startRate(ChargeableItem ciToReserve, 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, SessionEventListener listener)
          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 with best effort reservation; If the reservation fails due to a low-credit, an inverse charging 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 registered in the charging session to avoid providing it again or changing it at update time.

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.
See also: updateRate and stopRate

 void startRate(ChargeableItem ciToReserve, java.lang.String sessionID, java.util.Date consumptionDate, java.lang.String serviceID, java.lang.String userServiceID, int defaultResolution, long ttl, int resultType, SessionEventListener listener)
          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.
It is in charge of rating the reservation chargeable item and doing the related counter reservations. It creates a charging session (keeping the reserved chargeable item) and returns a charging result used to reserve a credit on the balance of a prepaid account.

Options: 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.

Operation Result: 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.

See also: updateRate and stopRate

 void stopRate(ChargeableItem confirmationItem, java.lang.String sessionID, java.lang.String serviceID, java.lang.String userServiceID, int resolution, int resultType, boolean ft, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate
 void stopRate(ChargeableItem confirmationItem, java.lang.String sessionID, java.lang.String serviceID, java.lang.String userServiceID, int resolution, int resultType, int cleanupResultType, boolean ft, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate
 void stopRate(ChargeableItem confirmationItem, java.lang.String sessionID, java.lang.String serviceID, java.lang.String userServiceID, int resolution, int resultType, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate
 void translate(java.lang.String tableCode, int operator, java.util.Date date, java.util.Date referenceDate, java.lang.String[] inValues, TranslateEventListener listener)
          Translates some values by using a translation table
 void translate(java.lang.String tableCode, int operator, java.util.Date date, java.lang.String[] inValues, TranslateEventListener listener)
          Translates some values by using a translation table configured in a pricing catalog
 void unregisterReservationRenewalListener(byte rrlId)
          Unregisters a Reservation Renewal Listener from the list of listeners, by its identifier.
 void unregisterSpendingStatusReportListener(byte ssrlId)
          Unregisters a Spending Status Report Listener from the list of listeners, by its identifier.
protected  void updateHandler(com.highdeal.barbus.ClientRequestHandler requestHandler)
          Updates this client with a client request handler.
 void 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, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update of a session-based rating.
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 taking the update date into account 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.
See also stopRate and startRate
 void 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, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update of a session-based rating.
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 taking the update date into account 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.
See also stopRate and startRate
 void updateRate(ChargeableItem confirmationItem, ChargeableItem reservationItem, java.lang.String sessionID, java.util.Date consumptionDate, java.lang.String serviceID, java.lang.String userServiceID, int resultType, SessionEventListener listener)
          Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update 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 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 taking the update date into account 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.
See also stopRate and startRate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.List<AsyncRatingServiceClient.RegisterListener> listeners

ratingListListener

protected final com.highdeal.cnd.message.AsyncRatingServiceClient.RLListener ratingListListener

NONE_TRANSACTION

public static final int NONE_TRANSACTION
Constant to return no usage transaction

See Also:
Constant Field Values

MASTER_TRANSACTION

public static final int MASTER_TRANSACTION
Constant to return the master usage transaction

See Also:
Constant Field Values

ALL_TRANSACTION

public static final int ALL_TRANSACTION
Constant to return all the usage transactions

See Also:
Constant Field Values

ALL_TRANSACTION_AND_RECURRING

public static final int ALL_TRANSACTION_AND_RECURRING
Constant to return all the usage transactions and all the recurring/one-shot transactions

See Also:
Constant Field Values

CANCELLED

public static final int CANCELLED
Constant to set up the resolution used when the time to live (TTL) is expired as canceled

See Also:
Constant Field Values

CONFIRMED

public static final int CONFIRMED
Constant to set up the resolution used when the time to live (TTL) is expired as confirmed

See Also:
Constant Field Values
Constructor Detail

AsyncStatefulServiceClient

public AsyncStatefulServiceClient()
Use one of the connect(..) methods to connect this client to the distant SAP CC system.


AsyncStatefulServiceClient

public AsyncStatefulServiceClient(java.lang.String hostName,
                                  int port)
                           throws java.io.IOException
Creates a charging client and connects it to the distant SAP CC Core Server system

Parameters:
hostName - The host name of the SAP CC Core Server system
port - The communication port on which the SAP CC system waits for requests via the Message TCP technical interface
Throws:
java.io.IOException - if the client cannot connect to the SAP CC system

AsyncStatefulServiceClient

public AsyncStatefulServiceClient(java.lang.String hostName,
                                  int port,
                                  int timeout)
                           throws java.io.IOException
Creates a charging client and 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 system
port - The communication port on which the SAP CC system waits for request via the Message TCP technical interface
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely) If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.
Throws:
java.io.IOException - if the client cannot connect to the SAP CC system (if the server system is not running, for instance)

AsyncStatefulServiceClient

public AsyncStatefulServiceClient(java.lang.String hostName,
                                  int port,
                                  FoundLostRatingListener ratingListener)
                           throws java.io.IOException
Initializes a charging client and connects it to the distant SAP CC Core Server system;

Parameters:
hostName - The host name of the SAP CC Core Server system
port - The communication port on which the SAP CC system waits for requests
ratingListener - The listener informed when rating is found or lost
Throws:
java.io.IOException - if the client cannot connect to the SAP CC system

AsyncStatefulServiceClient

public AsyncStatefulServiceClient(java.lang.String hostName,
                                  int port,
                                  java.lang.String bindAddress,
                                  int timeout,
                                  FoundLostRatingListener ratingListener)
                           throws java.io.IOException
Initializes a charging client and connects it to the distant SAP CC Core Server system;

Parameters:
bindAddress - The network address to bind to
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely); If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.
ratingListener - The listener informed when rating is found or lost
Throws:
java.io.IOException - if the client cannot connect to the SAP CC system
Method Detail

updateHandler

protected void updateHandler(com.highdeal.barbus.ClientRequestHandler requestHandler)
Updates this client with a client request handler.

Parameters:
requestHandler - The client request handler

charge

public final void charge(ChargeableItem ci,
                         java.lang.String serviceID,
                         java.lang.String userServiceID,
                         java.util.Date consumptionDate,
                         int ts,
                         boolean ft,
                         ChargeEventListener listener)
Consider the main charge operation in this class.

Parameters:
ci - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
ft - Sets if the returned transactions must be filtered according to the transactionTemplate
listener - The listener responsible for processing the results or exceptions of this operation

charge

public final void charge(ChargeableItem ci,
                         java.lang.String serviceID,
                         java.lang.String userServiceID,
                         java.util.Date consumptionDate,
                         int ts,
                         ChargeEventListener listener)
Consider the main charge operation in this class.

Parameters:
ci - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
listener - The listener responsible for processing the results or exceptions of this operation

charge

public final void charge(ChargeableItem ci,
                         java.lang.String serviceID,
                         java.lang.String userServiceID,
                         java.util.Date consumptionDate,
                         ChargeEventListener listener)

This main business operation requests the connected SAP CC system to rate and charge the specified chargeable item for the specified customer service and for the specified user service ID (technical ID of the end user in this customer server) at the specified date.

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 - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
listener - The listener responsible for processing the results or exceptions of this operation

charge

public final void charge(ChargeableItem ci,
                         java.lang.String serviceID,
                         java.lang.String userServiceID,
                         java.util.Date consumptionDate,
                         ChargeExecutionContext context,
                         ChargingResultListener listener)

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.

Parameters:
ci - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
context - The context in which the operation is executed
listener - The listener responsible for processing the result or exception of this operation

blankCharge

public final void blankCharge(ChargeableItem ci,
                              java.lang.String serviceID,
                              java.lang.String userServiceID,
                              java.util.Date consumptionDate,
                              int ts,
                              ChargeEventListener listener)

This main business operation requests the connected SAP CC system to charge in blank execution 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.

Parameters:
ci - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
listener - The listener responsible for processing the results or exceptions of this operation

blankCharge

public final void blankCharge(ChargeableItem ci,
                              java.lang.String serviceID,
                              java.lang.String userServiceID,
                              java.util.Date consumptionDate,
                              int ts,
                              boolean ft,
                              ChargeEventListener listener)
Consider the main blank charge operation in this class.

Parameters:
ci - The chargeable item to charge
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
ft - Sets if the returned transactions must be filtered according to the transactionTemplate
listener - The listener responsible for processing the results or exceptions of this operation

blankCharge

public final void blankCharge(ChargeableItem ci,
                              java.lang.String serviceID,
                              java.lang.String userServiceID,
                              java.util.Date consumptionDate,
                              ChargeExecutionContext context,
                              ChargingResultListener listener)

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.

Parameters:
ci - The chargeable item to advise
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
context - The context in which the operation is executed
listener - The listener responsible for processing the result or exception of this operation

getEstimatedPrice

@Deprecated
public final void getEstimatedPrice(ChargeableItem ci,
                                               java.lang.String serviceID,
                                               java.lang.String userServiceID,
                                               java.util.Date consumptionDate,
                                               int ts,
                                               ChargeEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation Consider the main get estimated price operation in this class. 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 service ID at the specified date without impacting the database.

Parameters:
ci - The chargeable item to determine the price
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
listener - The listener responsible for processing the results or exceptions of this operation

getEstimatedPrice

@Deprecated
public final void getEstimatedPrice(ChargeableItem ci,
                                               java.lang.String serviceID,
                                               java.lang.String userServiceID,
                                               java.util.Date consumptionDate,
                                               ChargeEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the blank charging operation This main business operation asks the connected SAP CC system to estimate the price relating to a service usage; The SAP CC system only processes the rating (dynamic pricing) of the service usage that is specified by a chargeable item, a user service ID, a service ID, and a consumption date. The accounting (account determination) is not processed.

Note

There is no impact to the customer mater data in the back-end database: The SAP CC system does not update the balances in subscriber account and the counters in contracts or subscriptions.

Recommendation

Refer to the description of the Java package for more information.

Parameters:
ci - The chargeable item representing the service usage that must be dynamically priced
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
listener - The listener responsible for processing the results or exceptions of this operation

getEstimatedPrice

@Deprecated
public final void getEstimatedPrice(ChargeableItem ci,
                                               java.lang.String serviceID,
                                               java.lang.String userServiceID,
                                               java.util.Date consumptionDate,
                                               int ts,
                                               boolean ft,
                                               ChargeEventListener listener)
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).
Asks the server to rate the specified chargeable item for the specified user service ID and service ID at the specified date without impacting the database.

Parameters:
ci - The chargeable item to determine the price
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
ts - The transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
ft - Sets if the returned transactions must be filtered according to the transactionTemplate
listener - The listener responsible for processing the results or the exceptions of this operation

checkLimit

public final void checkLimit(ChargeableItem ci,
                             java.lang.String serviceID,
                             java.lang.String userServiceID,
                             java.util.Date consumptionDate,
                             java.lang.String propertyName,
                             java.math.BigDecimal precision,
                             Money limitAmount,
                             boolean estimationMode,
                             CheckLimitEventListener listener)
This main business operation requests either an inverse rating operation or a best-effort charging operation.

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.

Note

When the limit amount of money is not provided (null value), the limit is retrieved from the account balances.

Options: You can specify the precision. The precision of the result must be one of the following: 1, 0.1, 0.01, 0.001 ...

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) from the end customer who uses the customer service.

Parameters:
ci - The chargeable item to use for the inverse rating or best-effort charging
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
propertyName - The name of the property in the chargeable item that is used by the inverse rating function (ex.: call duration in seconds)
precision - The precision for the computed property value
limitAmount - 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)
listener - The listener responsible for processing the results or exceptions of this operation

checkLimit

public final void checkLimit(ChargeableItem ci,
                             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,
                             CheckLimitEventListener listener)
Consider the main check limit operation.

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.

Parameters:
ci - the ChargeableItem to rate
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer
propertyName - the name of the property used by the inverse rating process
precision - the precision for the computed property value
limit - the limit to inverse (must positive or null)
estimationMode - the estimation mode
ts - the transaction selection NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION, ALL_TRANSACTION_AND_RECURRING
ft - sets if the returned transactions must be filtered according to the transactionTemplate
listener - the listener responsible for processing the results or exceptions of this operation

preRate

@Deprecated
public final void preRate(ChargeableItem ci,
                                     java.lang.String serviceID,
                                     java.lang.String userServiceID,
                                     java.util.Date consumptionDate,
                                     int resultType,
                                     long reservationUID,
                                     int defaultResolution,
                                     long ttl,
                                     PrePostRateEventListener listener)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice session-based charging services Asks the server to pre-rate 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 used of the same reservation unique identifier for more than one pre-rating. This case is managed at post-rating time.

Parameters:
ci - the ChargeableItem to rate.
serviceID - the service ID
userServiceID - 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 date
resultType - the result type (see PreRateOp for the constants)
reservationUID - the reservationUID used later to post-rate
defaultResolution - the default resolution to be used at expiration (see PreRateOp}for the constants)
ttl - the time to live given in seconds
listener - the listener responsible for processing the results or exceptions of this operation.

preRate

@Deprecated
public final void 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,
                                     PrePostRateEventListener listener)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice session-based charging services Asks the server to pre-rate 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 used of the same reservation unique identifier for more than one pre-rating. This case is managed at post-rating time.

Parameters:
ci - the ChargeableItem to rate.
serviceID - the service ID
userServiceID - 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 date
resultType - the result type (see PreRateOp for the constants)
ft - sets if the returned transactions must be filtered according to the transactionTemplate
reservationUID - the reservationUID used later to post-rate
defaultResolution - the default resolution to be used at expiration (see PreRateOp}for the constants)
ttl - the time to live given in seconds
listener - the listener responsible for processing the results or exceptions of this operation.

postRate

@Deprecated
public final void postRate(long reservationUID,
                                      java.lang.String serviceID,
                                      java.lang.String userServiceID,
                                      int resolution,
                                      int resultType,
                                      ChargeableItem newCi,
                                      PrePostRateEventListener listener)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice 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.

Parameters:
reservationUID - the reservationUID to post-rate
serviceID - 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
listener - the listener responsible for processing the results or exceptions of this operation.

postRate

@Deprecated
public final void postRate(long reservationUID,
                                      java.lang.String serviceID,
                                      java.lang.String userServiceID,
                                      int resolution,
                                      int resultType,
                                      boolean ft,
                                      ChargeableItem newCi,
                                      PrePostRateEventListener listener)
Deprecated. Deprecated since version 2.0 of SAP CC and replaced by the multiservice 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.

Parameters:
reservationUID - the reservationUID to post-rate
serviceID - 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 transactionTemplate
newCi - the new ChargeableItem to be used for this post-rating
listener - the listener responsible for processing the results or exceptions of this operation.

activate

public final void activate(java.lang.String subscriberAccountCode,
                           java.lang.String serviceProvider,
                           int resultType,
                           boolean ft,
                           java.util.Date toDate,
                           ActivateEventListener listener)
This main operation triggers the activation of all the periodic and one-off fees (see recurring rates and one-shot rates in the 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.

Note

You retrieve the result of this operation with a dedicated ActivateEventListener. It returns the related purchase order. The related purchase order which 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.

Parameters:
subscriberAccountCode - The identification code of the subscriber account representing an end customer of a service provider
serviceProvider - The identification code of the service provider, owner of both the pricing catalogs and the customer data (subscriber accounts, provider contracts, subscriptions, ...)
resultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION or ALL_TRANSACTION).
ft - Sets if the returned transactions must be filtered according to the transactionTemplate
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 -)
listener - The listener responsible for processing the results or exceptions of this operation
See Also:
ActivateEventListener

cleanup

public final void cleanup(java.lang.String subscriberAccountCode,
                          java.lang.String serviceProvider,
                          java.util.Date toDate,
                          int resultType,
                          boolean ft,
                          CleanupEventListener listener)
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.

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.

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).

See also: PreRateOp

Parameters:
subscriberAccountCode - The identification code of the subscriber account
serviceProvider - The identification code of the service provider
resultType - The result type to be returned (NO_TRANSACTION, MASTER_TRANSACTION or ALL_TRANSACTION)
ft - Sets if the returned transactions must be filtered according to the transactionTemplate
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 is thrown.
listener - The listener responsible for processing the results or exceptions of this operation

translate

public final void translate(java.lang.String tableCode,
                            int operator,
                            java.util.Date date,
                            java.lang.String[] inValues,
                            TranslateEventListener listener)
Translates some values by using a translation table configured in a pricing catalog

Parameters:
tableCode - The identification code of the translation table which must be used
operator - The comparison operator
date - The version date of the translation table
inValues - An array of String which represents the input values
listener - The listener responsible for processing the results or exceptions of this operation request
See Also:
for more information

translate

public final void translate(java.lang.String tableCode,
                            int operator,
                            java.util.Date date,
                            java.util.Date referenceDate,
                            java.lang.String[] inValues,
                            TranslateEventListener listener)
Translates some values by using a translation table

Parameters:
tableCode - The identification code of the translation table which must be used
operator - The comparison operator
date - The version date of the translation table
referenceDate - The reference date used to check the column "start date" and column "end date"
inValues - An array of String which represents the input values
listener - The listener responsible for processing the results or exceptions of this operation
See Also:
TranslateValueOp

startRate

@Deprecated
public final void startRate(ChargeableItem ciToReserve,
                                       java.lang.String sessionID,
                                       java.util.Date consumptionDate,
                                       java.lang.String serviceID,
                                       java.lang.String userServiceID,
                                       int defaultResolution,
                                       long ttl,
                                       int resultType,
                                       SessionEventListener listener)
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.
It is in charge of rating the reservation chargeable item and doing the related counter reservations. It creates a charging session (keeping the reserved chargeable item) and returns a charging result used to reserve a credit on the balance of a prepaid account.

Options: 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.

Operation Result: 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.

See also: updateRate and stopRate

Parameters:
ciToReserve - The chargeable item that represents the service usage to reserve (mandatory)
sessionID - The identifier of the charging session which has to be unique
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
defaultResolution - The default resolution of the charging session at expiration time (CANCELLED or CONFIRMED)
ttl - The time to live expressed in seconds
resultType - The charging result type to be returned (NONE_TRANSACTION, MASTER_TRANSACTION, ALL_TRANSACTION or ALL_TRANSACTION_AND_RECURRING)
listener - The listener responsible for processing the results or exceptions of this operation request
See Also:
updateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, boolean, SessionEventListener), stopRate(ChargeableItem, String, String, String, int, int, boolean, SessionEventListener)

startRate

@Deprecated
public final void startRate(ChargeableItem ciToReserve,
                                       java.lang.String sessionID,
                                       java.util.Date consumptionDate,
                                       java.lang.String serviceID,
                                       java.lang.String userServiceID,
                                       int defaultResolution,
                                       long ttl,
                                       int resultType,
                                       boolean ft,
                                       SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services Consider the main start rate operation for more information; You can specify if the resulting transactions must be filtered. This operation represents the start of a session-based charging.
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.
See also: updateRate and stopRate

Parameters:
ciToReserve - The chargeable item that represents the service usage to reserve (mandatory)
sessionID - The identifier of the charging session which has to be unique
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
defaultResolution - The default resolution of the charging session at expiration time (CANCELLED or CONFIRMED)
ttl - The time to live expressed in seconds
resultType - The charging 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
listener - The listener responsible for processing the results or exceptions of this operation request

startRate

@Deprecated
public final void startRate(ChargeableItem ciToReserve,
                                       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,
                                       SessionEventListener listener)
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 with best effort reservation; If the reservation fails due to a low-credit, an inverse charging 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 registered in the charging session to avoid providing it again or changing it at update time.

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.
See also: updateRate and stopRate

Parameters:
ciToReserve - The chargeable item that represents the service usage to reserve (mandatory)
sessionID - The identifier of the charging session which has to be unique
serviceID - The service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - The user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - The date the service was consumed by the end customer
defaultResolution - The default resolution of the charging session at expiration time (CANCELLED or CONFIRMED)
ttl - The time to live expressed in seconds
resultType - The charging 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
propertyToInverse - The name of the property to inverse in case of best effort reservation
listener - The listener responsible for processing the results or exceptions of this operation request
See Also:
updateRate(ChargeableItem, ChargeableItem, String, Date, String, String, int, boolean, SessionEventListener), stopRate(ChargeableItem, String, String, String, int, int, boolean, SessionEventListener)

updateRate

@Deprecated
public final void updateRate(ChargeableItem confirmationItem,
                                        ChargeableItem reservationItem,
                                        java.lang.String sessionID,
                                        java.util.Date consumptionDate,
                                        java.lang.String serviceID,
                                        java.lang.String userServiceID,
                                        int resultType,
                                        SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update 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 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 taking the update date into account 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.
See also stopRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
reservationItem - the reservation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer
resultType - the rating result type to be returned (NONE_TRANSACTION or MASTER_TRANSACTION, ALL_TRANSACTION)
listener - the listener responsible for processing the results or exceptions of this operation.

updateRate

@Deprecated
public final void 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,
                                        SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update of a session-based rating.
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 taking the update date into account 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.
See also stopRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
reservationItem - the reservation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer
resultType - 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
listener - the listener responsible for processing the results or exceptions of this operation.

updateRate

@Deprecated
public final void 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,
                                        SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the update of a session-based rating.
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 taking the update date into account 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.
See also stopRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
reservationItem - the reservation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer
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
listener - the listener responsible for processing the results or exceptions of this operation.

stopRate

@Deprecated
public final void stopRate(ChargeableItem confirmationItem,
                                      java.lang.String sessionID,
                                      java.lang.String serviceID,
                                      java.lang.String userServiceID,
                                      int resolution,
                                      int resultType,
                                      SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
resolution - 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)
listener - the listener responsible for processing the results or exceptions of this operation.

stopRate

@Deprecated
public final void stopRate(ChargeableItem confirmationItem,
                                      java.lang.String sessionID,
                                      java.lang.String serviceID,
                                      java.lang.String userServiceID,
                                      int resolution,
                                      int resultType,
                                      boolean ft,
                                      SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
resolution - 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
listener - the listener responsible for processing the results or exceptions of this operation.

stopRate

@Deprecated
public final void stopRate(ChargeableItem confirmationItem,
                                      java.lang.String sessionID,
                                      java.lang.String serviceID,
                                      java.lang.String userServiceID,
                                      int resolution,
                                      int resultType,
                                      int cleanupResultType,
                                      boolean ft,
                                      SessionEventListener listener)
Deprecated. Deprecated since version 4.0 of SAP CC and replaced by the multiservice session-based charging services This operation class represents the stop of a session-based rating.
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 canceled. 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.
See also updateRate and startRate

Parameters:
confirmationItem - the confirmation item (optional, null value is accepted)
sessionID - the session identifier previously used
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
resolution - 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
listener - the listener responsible for processing the results or exceptions of this operation.

createSessionStartAsyncOperation

public ISessionStartChargingAsyncOperation createSessionStartAsyncOperation(java.lang.String sessionID,
                                                                            java.lang.String userServiceID,
                                                                            java.lang.String serviceID,
                                                                            java.util.Date consumptionDate)
This method creates a start operation in order to process an initial event of a session-based charging scenario.
The interface returned by this method allows defining several reservations through multiple calls to prepareReserve. When all the reservations are prepared, a call to execute sends the request.
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 Rating Session is created and a rating result is returned. This return can be used to reserve the balance.
This operation should be executed only once. It must not be reused for future calls.

Parameters:
sessionID - the session identifier which has to be unique
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer (this date is used as a consumption date for reservations)
Returns:
The operation in charge of collecting and executing the reservations
See Also:
createSessionUpdateAsyncOperation(java.lang.String, java.lang.String, java.lang.String, java.util.Date), createSessionStopAsyncOperation(String, String, String, Date)

createSessionUpdateAsyncOperation

public ISessionUpdateChargingAsyncOperation createSessionUpdateAsyncOperation(java.lang.String sessionID,
                                                                              java.lang.String userServiceID,
                                                                              java.lang.String serviceID,
                                                                              java.util.Date consumptionDate)
This method creates an update operation in order to process an update event of a session-based charging scenario.
The interface returned by this method allows defining several: When all the reservations, confirmations, cancellations and reservation extensions are prepared, a call to execute sends the request.
This 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 Rating Session is created and a rating result is returned. This return can be used to reserve the balance. If the Rating Session already exists, it is updated with the new reservation.
This operation should be executed only once. It must not be reused for future calls.

Parameters:
sessionID - the session identifier which has to be unique
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date the service was consumed by the end customer (this date is used as a consumption date for new reservations)
Returns:
The operation in charge of collecting and executing the reservations and the confirmations
See Also:
createSessionStartAsyncOperation(String, String, String, Date), createSessionStopAsyncOperation(String, String, String, Date)

createSessionStopAsyncOperation

public ISessionStopChargingAsyncOperation createSessionStopAsyncOperation(java.lang.String sessionID,
                                                                          java.lang.String userServiceID,
                                                                          java.lang.String serviceID,
                                                                          java.util.Date consumptionDate)
This method creates a stop operation in order to process a termination event of a session-based charging scenario.
This operation can manage several: When all the confirmations and cancellations are prepared, a call to execute sends the request.
This operation confirms (partially or totally) a previous reservation. Alternatively it is able to cancel the reservation. This operation should be executed only once. It must not be reused for future calls.

Parameters:
sessionID - the session identifier which has to be unique
serviceID - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
userServiceID - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
consumptionDate - the date when the session stops
Returns:
The operation in charge of collecting and executing the confirmations
See Also:
createSessionStartAsyncOperation(String, String, String, Date), createSessionUpdateAsyncOperation(java.lang.String, java.lang.String, java.lang.String, java.util.Date)

handleSessionRequest

protected final void handleSessionRequest(SessionChargingOperation op,
                                          ISessionResultListener listener)

registerReservationRenewalListener

public void registerReservationRenewalListener(byte rrlId,
                                               IReservationRenewalListener rrl)
                                        throws java.lang.IllegalArgumentException,
                                               CommunicationFailureException,
                                               ServerFailureException
Registers a Reservation Renewal Listener (RRL) with its identifier. A reservation renewal listener identifier (RRLid) can be used only once in a charging client. But it can also be re-used by other charging clients. As a consequence it is possible to register several reservation renewal listeners with the same reservation renewal listener identifier (one per charging client, at most). In such a situation SAP CC will always select the oldest stateful service client registered with this reservation renewal listener identifier, which is still alive at the time the renew reservation notification must be sent.

Note

The registration request is sent to all the available dispatchers. Each dispatcher updates its own map of RRLids. If the dispatcher cannot update its map, an exception is thrown. In case heartbeat mechanism detects that the connection is down, the stateful service client will register again upon reconnection, the set of defined RRL. In case a new dispatcher is started then the registration process is performed right after the connection process.

Parameters:
rrlId - The identifier of the reservation renewal listener to register (accepted values: 1 to 127)
rrl - The reservation renewal listener to register
Throws:
java.lang.IllegalArgumentException - The supported values for a RRLid are 1 to 127 included. A value out of this range or a duplicate RRLid can throw this exception.
CommunicationFailureException - Thrown when the charging client cannot communicate with the dispatcher instances on the server system side.
ServerFailureException - Thrown when the map of RRLids cannot be updated by the dispatcher instances on the server system side.

unregisterReservationRenewalListener

public void unregisterReservationRenewalListener(byte rrlId)
                                          throws java.lang.IllegalArgumentException,
                                                 CommunicationFailureException,
                                                 ServerFailureException
Unregisters a Reservation Renewal Listener from the list of listeners, by its identifier.

Parameters:
rrlId - The identifier of the reservation renewal listener to unregister (accepted values: 1 to 127)
Throws:
java.lang.IllegalArgumentException - The supported values for a RRLid are 1 to 127 included. A value out of this range or an unknown RRLid can throw this exception.
CommunicationFailureException - Thrown when the charging client cannot communicate with the dispatcher instances on the server system side.
ServerFailureException - Thrown when the map of RRLids cannot be updated by the dispatcher instances on the server system side.

registerSpendingStatusReportListener

public void registerSpendingStatusReportListener(byte ssrlId,
                                                 ISpendingStatusReportListener ssrl)
                                          throws java.lang.IllegalArgumentException,
                                                 CommunicationFailureException,
                                                 ServerFailureException
Registers a Spending Status Report Listener (SSRL) with its identifier. A spending status report listener identifier (SSRL ID) can be used only once in a monitoring client. Other monitoring clients can reused this SSRL ID. It is possible to register several spending status report listeners with the same SSRL ID (one per monitoring client, at most). The SAP CC always selects the oldest monitoring client registered with this SSRL ID and that is still alive at the time the spending status report notification must be sent.

Note

The monitoring client sends the registration request to all the available dispatcher instances of the connected SAP CC system. Each dispatcher instance updates its own map of SSRL IDs. If a dispatcher instance cannot update its map, an exception is thrown. In case the heartbeat mechanism detects that the connection is down, the monitoring client registers again upon reconnection, the set of defined SSRL. If a new dispatcher instance is started in the SAP CC system, then the registration process is performed just after the connection process.

Parameters:
ssrlId - The identifier of the spending status report listener to register (accepted values: 1 to 127)
ssrl - The spending status report listener to register
Throws:
java.lang.IllegalArgumentException - The supported values for a SSRL ID are 1 to 127 included. A value out of this range or a duplicate SSRL ID can throw this exception.
CommunicationFailureException - Thrown when the monitoring client cannot communicate with the dispatcher instances on the SAP CC system side.
ServerFailureException - Thrown when the map of SSRL IDs cannot be updated by the dispatcher instances on the SAP CC system side.

unregisterSpendingStatusReportListener

public void unregisterSpendingStatusReportListener(byte ssrlId)
                                            throws java.lang.IllegalArgumentException,
                                                   CommunicationFailureException,
                                                   ServerFailureException
Unregisters a Spending Status Report Listener from the list of listeners, by its identifier.

Parameters:
ssrlId - The identifier of the spending status report listener to unregister (accepted values: 1 to 127)
Throws:
java.lang.IllegalArgumentException - The supported values for a SSRLid are 1 to 127 included. A value out of this range or an unknown SSRL ID can throw this exception.
CommunicationFailureException - Thrown when the monitoring client cannot communicate with the dispatcher instances on the SAP CC system side.
ServerFailureException - Thrown when the map of SSRL IDs cannot be updated by the dispatcher instances on the server system side.

monitorSpendingStatus

public void monitorSpendingStatus(java.lang.String monitoringId,
                                  byte ssrlId,
                                  java.lang.String userServiceId,
                                  java.lang.String[] spendingStatusIds,
                                  int ttl,
                                  IMonitorSpendingStatusResultListener monitorSpendingStatusResultListener)
                           throws java.lang.IllegalArgumentException
Manages the monitoring of spending statuses that relate to an end customer (see userServiceId) during customer service charging and refilling operations
The spending status monitoring is identified by the monitoringId.
The spendingStatusIds contains the list of spending status identifiers to monitor. This list can be:
The TTL "Time-To-Live" indicates a period of time (in seconds) after wich the SAP CC system automatically stops this spending status monitoring. The resend of pending spending status report(s) that relate to this monitoring is also canceled.
The monitor spending status result listener receive the result of this opeation and contains the performed operation and the current label value for each monitored spending status.

Prerequisite

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.

Parameters:
monitoringId - The identifier of the spending status monitoring
ssrlId - The identifier of the SpendingStatusReportListener (accepted values: 1 to 127)
userServiceId - The user service identifier (USID): A technical identifier of the user
spendingStatusIds - Identifying the set of spending statuses to monitor
ttl - The time to live given in seconds
monitorSpendingStatusResultListener - Receiving the result of this invocation
Throws:
java.lang.IllegalArgumentException -
  • when monitoringId, userServiceId is null or empty
  • when the ssrlId is not in the range [1, 127]
  • when one identifier provided in spendingStatusIds is null or empty
  • when an identifier is duplicated in the spendingStatusIds
  • when the monitorSpendingStatusResultListener is null

getRatingTopic

protected final com.highdeal.barbus.Topic getRatingTopic()
Gets the rating topic of this client used to send rating messages.

Returns:
The rating topic of this client

getTopicsToSubscribe

protected final com.highdeal.barbus.Topic[] getTopicsToSubscribe()
Returns an array of topics that client must subscribe to.

Returns:
An array of topics

getDefaultServiceClientTuning

protected final ServiceClientTuning getDefaultServiceClientTuning()
Gets the default service tuning of this client useful to configure connections.

Returns:
The service tuning of this client

currentQueueSize

protected final int currentQueueSize(short partitionID)
                              throws CommunicationFailureException
FOR INTERNAL USE ONLY - This method is for internal use only. It returns the size of the message queue of the stateful service server.

Parameters:
partitionID - the partition identifier
Returns:
the size of the queue of the stateful service server.
Throws:
CommunicationFailureException - thrown if a communication failure occurs

checkDB

protected final boolean checkDB(short partitionID)
                         throws CommunicationFailureException
FOR INTERNAL USE ONLY - This method is for internal use only. It returns a boolean specifying if the SAP CC system is connected to the back-end database system.

Parameters:
partitionID - the partition identifier
Returns:
a boolean specifying if the server is connected to the database
Throws:
CommunicationFailureException - thrown if a communication failure occurs

getSslContext

public javax.net.ssl.SSLContext getSslContext()
Returns the SSL context used with secure connections.

Specified by:
getSslContext in interface com.highdeal.barbus.ISSLContextProvider
Returns:
The SSL context used with secure connections

setSslContext

public void setSslContext(javax.net.ssl.SSLContext sslContext)
Sets the SSL context used with secure connections.

Parameters:
sslContext - The SSL context used with secure connections

connect

public final void connect(java.lang.String hostname,
                          int hostport)
                   throws java.io.IOException
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.

This method is equivalent to: connect(hostname, hostport, -1, null);.

Parameters:
hostname - The name of the machine that hosts a dispatcher instance of the SAP CC Core Server system
hostport - The communication port on which the server system waits for requests on TCP/IP channel used by the Message TCP/IP technical interface
Throws:
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running, for example).

connect

public final void connect(java.lang.String hostname,
                          int hostport,
                          int timeout)
                   throws java.io.IOException
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.

This method is equivalent to: connect(hostname, hostport, null, timeout);.

Parameters:
hostname - The name of the machine that hosts a dispatcher instance of the SAP CC Core Server system
hostport - The port on which the server waits for requests
timeout - 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.
Throws:
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running for example)

connect

public final void connect(java.lang.String hostname,
                          int hostport,
                          FoundLostRatingListener ratingListener)
                   throws java.io.IOException
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.

Parameters:
hostname - The host name of the server
hostport - The port on which the server waits for request
ratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lost
Throws:
java.io.IOException - if the client cannot connect to the distant SAP CC system (if server is not running, for example)

connect

public final void connect(java.lang.String hostname,
                          int hostport,
                          java.lang.String bindAddress,
                          int timeout,
                          FoundLostRatingListener ratingListener)
                   throws java.io.IOException
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.

Parameters:
hostname - The host name of the server
hostport - The port on which the server waits for request
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending the request.
ratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lost.
Throws:
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

connect

public final void connect(java.lang.String hostname,
                          int port,
                          java.lang.String bindAddress,
                          int timeout,
                          FoundLostRatingListener ratingListener,
                          ServiceClientTuning config)
                   throws java.io.IOException
Connects this message client with the Rating Instances.

First of all, this client contacts the boot instance defined by the arguments hostname and port to get its instance map. Then this client opens connections with all the rating instances defined in the instance map.

Parameters:
hostname - The host name of the server
port - The port on which the server waits for request
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending the request.
ratingListener - The FoundLostRatingListener that will be notified each time a rating instance will be found or lost
config - The service tuning configuration
Throws:
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.

connect

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
Connects this message client with the Rating Instances.

First of all, this client contacts the boot instance defined by the arguments hostname and port to get its instance map. Then this client opens connections with all the rating instances defined in the instance map.

Parameters:
hostname - The host name of the server
port - The port on which the server waits for request
secure - true if the connection to the server is secure
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.
ratingListener - The FoundLostRatingListener that will be notified each time a Rating Instance will be found or lost.
config - The service tuning configuration
Throws:
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.

connect

public final void connect(java.lang.String systemName,
                          java.net.InetSocketAddress... bootDispatcherAddresses)
                   throws java.io.IOException
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.

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.

Parameters:
systemName - The SAP CC system name
bootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
Throws:
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

connect

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
Connects this message client with the Rating Instances.

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.

Parameters:
systemName - The SAP CC system name
lookupDuration - The system discovery lookup duration
discoveryAddress - The lookup discovery address, which must be an IPv4 multicast address
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending request.
ratingListener - The FoundLostRatingListener that will be notified each time a Rating Instance will be found or lost.
config - The service tuning configuration
bootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
Throws:
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

connect

public final void connect(java.lang.String systemName,
                          com.highdeal.barbus.InstanceAddress... bootDispatcherAddresses)
                   throws java.io.IOException
Connects this charging client with the Rating Instances.

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.

Parameters:
systemName - The SAP CC system name
bootDispatcherAddresses - a backup rating instance boot dispatcher list, provided only if for some reasons
Throws:
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

connect

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
Connects this charging client with the SAP CC system by using the UDP discovery function.

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.

Parameters:
systemName - The Rating system name
lookupDuration - The system discovery lookup duration
discoveryAddress - The lookup discovery address, which must be an IPv4 multicast address
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending the request.
ratingListener - The FoundLostRatingListener that will be notified each time a Rating Instance will be found or lost.
config - The service tuning configuration
bootDispatcherAddresses - A backup rating instance boot dispatcher list, provided only if for some reasons
Throws:
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

connect

public final void connect(InstanceMap imap,
                          java.lang.String bindAddress,
                          int timeout,
                          FoundLostRatingListener ratingListener,
                          ServiceClientTuning config)
                   throws java.io.IOException
Connects this charging client with the SAP CC system by using an instance map; A timeout must be specified.

Parameters:
imap - The instance map that describes the SAP CC system to connect to; Cannot be null.
bindAddress - The address to bind to, can be null
timeout - The timeout in milliseconds for each request (or -1 to wait indefinitely). If you use zero and acknowledgments are requested then a CommunicationFailureException will be thrown without sending the request.
ratingListener - The FoundLostRatingListener that will be notified each time a rater instance will be found or lost.
config - The service tuning configuration
Throws:
java.io.IOException - if the client cannot connect to the distant SAP CC system (if the server system is not running, for example).

isNoTimeout

public final boolean isNoTimeout()
Checks if this charging client handles timeout.

Returns:
true if the charging client handles timeout

setNoTimeout

public final void setNoTimeout(boolean noTimeout)
Sets that this charging client handles timeout.

Parameters:
noTimeout - true if your client handles timeout

setClientOpEventListener

public final 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.
  • It is not possible to set null for the default topic.
  • If the listener is null, then the default listener is set (@link ClientOpEventTopic#DEFAULT).

Parameters:
topic - The topic to plug the client operation event listener to
listener - The client operation event listener

getClientOpEventListener

public final ClientOpEventListener getClientOpEventListener(ClientOpEventTopic topic)
Gets the 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.

Parameters:
topic - The topic plugged the client operation event listener
Returns:
not null

getTimeout

public final int getTimeout()
Returns the client communication timeout in milliseconds for each request (or -1 to wait indefinitely).

Returns:
The timeout in milliseconds, or -1 if no timeout has been defined

isConnected

public final boolean isConnected()
Gets the connected connection status.

Returns:
true if the charging client is connected and false otherwise.

close

public final 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.


setBootMode

@Deprecated
public final void setBootMode(BootMode mode)
Deprecated. 

Defines which API will be used to retrieve from the remote instances, the Instance Map needed for the connection. As BootMode.HTTP_BOOT_MODE and BootMode.HTTPS_BOOT_MODE are deprecated, this method is deprecated too.

Parameters:
mode - Is this method is deprecated and to use the Message TCP communication or is HTTP_BOOT_MODE to use the HTTP communication.

getBootMode

public final BootMode getBootMode()
Returns which API is used to retrieve from the remote instances, the Instance Map needed for the connection.

Returns:
MESSAGE_BOOT_MODE because BootMode.HTTP_BOOT_MODE and BootMode.HTTPS_BOOT_MODE are deprecated.

isValid

protected final 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.

Parameters:
ci - The chargeable item to check
listener - The call back listener
Returns:
true if chargeable item is valid, false otherwise

asyncSend

protected final 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.

Parameters:
m - The message that must be sent asynchronously
maxTimeout - The maximum timeout before getting a communication failure
handler - The call back handler

beginSession

protected final 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. If there is already a session, the session is sent by a call of the method sendSession() and a new session is created.


sendSession

protected final void sendSession()
FOR INTERNAL USE ONLY - All the messages between the last call of the method beginSession() and now for this thread are sent. The memory session is closed.


getEventListenerFromListener

protected com.highdeal.util.IEventListener getEventListenerFromListener(java.lang.Object listener)

setClusterName

@Deprecated
protected final void setClusterName(java.lang.String name)
Deprecated. Deprecated since version 2.0 of SAP CC

Sets the system name from the cluster name.

Parameters:
name - The system name

getClusterName

@Deprecated
protected final java.lang.String getClusterName()
Deprecated. Deprecated since version 2.0 of SAP CC Gets the system name.

Returns:
The system name

setHAEventListener

@Deprecated
public final void setHAEventListener(HAEventListener listener)
Deprecated. Deprecated since version 0.0 of SAP CC

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.

Parameters:
listener - The listener for High Availability events

setFoundLostRatingListener

protected final 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.

Parameters:
ratingListener - The rating listener
See Also:
getFoundLostRatingListener()

getFoundLostRatingListener

protected final FoundLostRatingListener getFoundLostRatingListener()
Returns the rating listener previously set.

Returns:
The rating listener previously set
See Also:
setFoundLostRatingListener(FoundLostRatingListener)

getClient

@Deprecated
protected final com.highdeal.barbus.RoundRobinClient getClient()
Deprecated. Deprecated since version 2.0 of SAP CC and should not be called anymore

Gets the inner client.

Returns:
inner client

notifyHeartBeat

protected final void notifyHeartBeat(com.highdeal.barbus.Client client)

register

protected final void register(com.highdeal.hmi.IConnectable connectable)

addListener

protected void addListener(AsyncRatingServiceClient.RegisterListener listener)

getSensorsManager

protected com.highdeal.cnd.message.sensor.SensorsManager getSensorsManager()

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)