com.highdeal.cnd.message
Class SessionChargingOperation

java.lang.Object
  extended by com.highdeal.cnd.message.SessionChargingOperation
All Implemented Interfaces:
IExternalDataSettable, IReservationRenewalListenerIdSettable, ISessionAsyncOperation, ISessionConfirmAndReserve, ISessionConfirmation, ISessionDefaultAttributeHolder, ISessionOperation, ISessionReservation, ISessionStartChargingAsyncOperation, ISessionStartChargingOperation, ISessionStopChargingAsyncOperation, ISessionStopChargingOperation, ISessionUpdateChargingAsyncOperation, ISessionUpdateChargingOperation

public class SessionChargingOperation
extends java.lang.Object
implements ISessionStartChargingAsyncOperation, ISessionStopChargingAsyncOperation, ISessionUpdateChargingAsyncOperation, ISessionStartChargingOperation, ISessionUpdateChargingOperation, ISessionStopChargingOperation

FOR INTERNAL USE ONLY - This Java class represents a multiservice session operation request that is sent to the connected SAP CC system to manage session-based charging services.


Nested Class Summary
protected  class SessionChargingOperation.SessionChargingOperationItem
           
static class SessionChargingOperation.SessionChargingOperationType
          FOR INTERNAL USE ONLY - This enumeration lists the types of operations: START, UPDATE, and STOP.
 
Nested classes/interfaces inherited from interface com.highdeal.cnd.message.ISessionDefaultAttributeHolder
ISessionDefaultAttributeHolder.TransactionSelectionCriteria
 
Nested classes/interfaces inherited from interface com.highdeal.cnd.message.ISessionReservation
ISessionReservation.SessionReservationResolution
 
Constructor Summary
SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType, java.lang.String sessionId, java.lang.String userServiceId, java.lang.String serviceId, java.util.Date consumptionDate)
          Builds a new SessionChargingOperation
 
Method Summary
protected  void enqueue(SessionChargingOperation.SessionChargingOperationItem item)
           
 ISessionOperationResult execute()
          Executes the operation to process an event of a session-based charging scenario.
 void execute(ISessionResultListener listener)
          Executes the operation to process an event of a session-based charging scenario.
 ISessionDefaultAttributeHolder.TransactionSelectionCriteria getCleanUpResultType()
          Returns the cleanUpResultType.
 java.util.Date getConsumptionDate()
          Returns the consumption date.
 SessionChargingOperation.SessionChargingOperationType getOpType()
          Returns the type of session-based charging operation: start, update, or stop.
 ISessionDefaultAttributeHolder.TransactionSelectionCriteria getResultType()
          Indicates the selection criteria for the returned transactions.
 java.lang.String getServiceId()
          Returns the service ID (SID): a technical ID for the customer service of a service provider
 java.lang.String getSessionId()
          Returns the multiservice session identifier.
 java.lang.String getUserServiceId()
          Returns the user service ID (USID): a technical ID for the end customer who uses (consumes) a customer service of a service provider
 boolean isFilterTransaction()
          Indicates whether or not returned transactions are filtered
 void prepareCancel(java.lang.String reservationId)
          This method allows you to cancel a reservation during a session-based charging.
 void prepareConfirm(java.lang.String reservationId, ChargeableItem confirmationItem)
          This method allows you to confirm a reservation in a charging session included in a multiservice session (or customer session).
 void prepareConfirmAndReserve(java.lang.String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem)
          This method allows you to confirm and extend a reservation during a session-based charging.
 void prepareReserve(java.lang.String reservationId, ChargeableItem reservationItem, ISessionReservation.SessionReservationResolution defaultResolution, long ttl, java.lang.String propertyToInverse)
          This method allows you to create a reservation request during session-based charging operations.
 void setCleanUpResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria cleanUpResultType)
          Specifies the cleanUp result Type to the value of cleanUpResultType.
 void setExternalData(byte[] externalData)
          Sets the external data that is included in the renew reservation notifications by the connected SAP CC system.
 void setFilterTransaction(boolean ft)
          Defines whether or not returned transactions have to be filtered
 void setReservationRenewalListenerId(byte rrlId)
          Sets the identifier of the reservation renewal listener (RRL).
 void setResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria rt)
          Specifies the selection criteria for the returned transactions: ISessionDefaultAttributeHolder.TransactionSelectionCriteria.ALL_TRANSACTION.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionChargingOperation

public SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType,
                                java.lang.String sessionId,
                                java.lang.String userServiceId,
                                java.lang.String serviceId,
                                java.util.Date consumptionDate)
Builds a new SessionChargingOperation

Parameters:
opType - the operation type
sessionId - the session identifier which has to be unique
userServiceId - the user service identifier (USID), which represents a technical identifier of the end customer consuming the service
serviceId - the service identifier (SID), which represents a technical identifier of the service provided by the service provider
consumptionDate - the date the service was consumed by the end customer (this date is used as a consumption date for reservations)
Method Detail

getSessionId

public java.lang.String getSessionId()
Returns the multiservice session identifier.

Returns:
The multiservice session ID

getUserServiceId

public java.lang.String getUserServiceId()
Returns the user service ID (USID): a technical ID for the end customer who uses (consumes) a customer service of a service provider

Returns:
The USID

getServiceId

public java.lang.String getServiceId()
Returns the service ID (SID): a technical ID for the customer service of a service provider

Returns:
The SID

getConsumptionDate

public java.util.Date getConsumptionDate()
Returns the consumption date.

Returns:
The consumption date

setResultType

public void setResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria rt)
Specifies the selection criteria for the returned transactions: ISessionDefaultAttributeHolder.TransactionSelectionCriteria.ALL_TRANSACTION.

Specified by:
setResultType in interface ISessionDefaultAttributeHolder
Parameters:
rt - The selection criteria for the returned transactions

getResultType

public ISessionDefaultAttributeHolder.TransactionSelectionCriteria getResultType()
Description copied from interface: ISessionDefaultAttributeHolder
Indicates the selection criteria for the returned transactions.

Specified by:
getResultType in interface ISessionDefaultAttributeHolder
Returns:
The selection criteria for the returned transactions

getCleanUpResultType

public ISessionDefaultAttributeHolder.TransactionSelectionCriteria getCleanUpResultType()
Returns the cleanUpResultType.

Specified by:
getCleanUpResultType in interface ISessionDefaultAttributeHolder
Returns:
The cleanUp result type

setCleanUpResultType

public void setCleanUpResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria cleanUpResultType)
Specifies the cleanUp result Type to the value of cleanUpResultType.

Specified by:
setCleanUpResultType in interface ISessionDefaultAttributeHolder
Parameters:
cleanUpResultType - The cleanUpResultType to set

setFilterTransaction

public void setFilterTransaction(boolean ft)
Description copied from interface: ISessionDefaultAttributeHolder
Defines whether or not returned transactions have to be filtered

Specified by:
setFilterTransaction in interface ISessionDefaultAttributeHolder
Parameters:
ft - true if transactions must be filtered, false otherwise

isFilterTransaction

public boolean isFilterTransaction()
Description copied from interface: ISessionDefaultAttributeHolder
Indicates whether or not returned transactions are filtered

Specified by:
isFilterTransaction in interface ISessionDefaultAttributeHolder
Returns:
true if transactions are filtered, false otherwise

getOpType

public SessionChargingOperation.SessionChargingOperationType getOpType()
Returns the type of session-based charging operation: start, update, or stop.

Returns:
The operation type

setReservationRenewalListenerId

public void setReservationRenewalListenerId(byte rrlId)
                                     throws java.lang.IllegalArgumentException
Description copied from interface: IReservationRenewalListenerIdSettable
Sets the identifier of the reservation renewal listener (RRL). The identifier is an unsigned byte between 1 and 127. The value 0 is kept for unset values.

Specified by:
setReservationRenewalListenerId in interface IReservationRenewalListenerIdSettable
Parameters:
rrlId - The registration identifier of the reservation renewal listener (RRL)
Throws:
java.lang.IllegalArgumentException - when the value is not an unsigned byte between 1 and 127

setExternalData

public void setExternalData(byte[] externalData)
Description copied from interface: IExternalDataSettable
Sets the external data that is included in the renew reservation notifications by the connected SAP CC system. The external data is a byte array. The size of this array must be lower than or equal to 1,023 bytes.

Note

External data must not be null but it can be empty.

Specified by:
setExternalData in interface IExternalDataSettable
Parameters:
externalData - The external data

prepareReserve

public void prepareReserve(java.lang.String reservationId,
                           ChargeableItem reservationItem,
                           ISessionReservation.SessionReservationResolution defaultResolution,
                           long ttl,
                           java.lang.String propertyToInverse)
Description copied from interface: ISessionReservation
This method allows you to create a reservation request during session-based charging operations.

It triggers in the connected SAP CC system, the rating (dynamic pricing) and reservation of the specified chargeable item by performing the related counter reservations.

Note

If the reservation fails due to a low-credit, an inverse rating may be attempted if the property name of the property to inverse is specified. This mechanism is known as best effort reservation. This property name is saved in the charging session to avoid providing it again or changing it at update.

Options: You use the parameters ttl and defaultResolution to set up an automated processing (reservation confirmation or reservation cancellation), when the time to live (TTL) has expired. The SAP CC system manages the last counter or balance reservations accordingly.

Specified by:
prepareReserve in interface ISessionReservation
Parameters:
reservationId - The reservation identifier that must be unique within a session
reservationItem - The mandatory chargeable item that includes the service consumption information
defaultResolution - The default resolution of the rating session at expiration time (ISessionReservation.SessionReservationResolution.CANCELLED or ISessionReservation.SessionReservationResolution.CONFIRMED)
ttl - The time to live (TTL) expressed in seconds
propertyToInverse - The name of the property in the reservationItem to inverse in case of best effort reservation

prepareConfirm

public void prepareConfirm(java.lang.String reservationId,
                           ChargeableItem confirmationItem)
Description copied from interface: ISessionConfirmation
This method allows you to confirm a reservation in a charging session included in a multiservice session (or customer session).

First, the SAP CC system retrieves the stored charging session and its data and re-rate the reservation item to compute a first rating result used by your charging client to cancel the previous balance reservation. The transactions from this rating result are provided to the TIF.

Second, the SAP CC system 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 back-end 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.

Finally, the charging session is removed and the reservation identifier becomes available for next reservations.

Specified by:
prepareConfirm in interface ISessionConfirmation
Parameters:
reservationId - The reservation identifier that must be unique within a multiservice session; This ID identifies a charging session.
confirmationItem - The reservation item; It is optional, null, or partially defined.

prepareCancel

public void prepareCancel(java.lang.String reservationId)
Description copied from interface: ISessionConfirmation
This method allows you to cancel a reservation during a session-based charging.

You add this reservation cancellation request in an update or stop operation of a multiservice session.

Once the session operation (update or stop) is received, the SAP CC system retrieves the charging session first and cancels the related counter reservations coming from either a previous reservation or a reservation extension. The rating result that is returned is empty in case of cancellation.

The charging session is removed and the reservation identifier becomes available for next reservations and new charging sessions.

Specified by:
prepareCancel in interface ISessionConfirmation
Parameters:
reservationId - The reservation identifier that must be unique within a multiservice session; This ID identifies a charging session.

prepareConfirmAndReserve

public void prepareConfirmAndReserve(java.lang.String reservationId,
                                     ChargeableItem confirmationItem,
                                     ChargeableItem reservationItem)
Description copied from interface: ISessionConfirmAndReserve
This method allows you to confirm and extend a reservation during a session-based charging.

First, the SAP CC system retrieves the charging session and re-rate the reservation item to compute a first rating result used by your client application to cancel the previous balance reservation. The transactions from this rating result are provided to the TIF.

Second, the SAP CC system consolidates a chargeable item for confirmation using both the reservation one from the charging session and the confirmation one if present. This chargeable item is rated and previously reserved counters are updated into the back-end database. A second rating result is then available for your client application to confirm the balance reservation. The transactions from this rating result are also provided to the TIF.

Third, the SAP CC system consolidates a chargeable item for reservation using both the old reservation item (from the charging 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 charging session with the new reservation chargeable item.

Specified by:
prepareConfirmAndReserve in interface ISessionConfirmAndReserve
Parameters:
reservationId - The reservation identifier that must be unique within a session
confirmationItem - The confirmation item (optional, null, or partially defined items are accepted)
reservationItem - The reservation item (optional, null, or partially defined items are accepted)

execute

public void execute(ISessionResultListener listener)
Description copied from interface: ISessionAsyncOperation
Executes the operation to process an event of a session-based charging scenario.

Specified by:
execute in interface ISessionAsyncOperation
Parameters:
listener - The listener responsible for processing the results or exceptions of this operation request

execute

public ISessionOperationResult execute()
                                throws ServerFailureException,
                                       java.lang.IllegalArgumentException,
                                       CommunicationFailureException,
                                       ForbiddenChargeException,
                                       SessionOperationException
Description copied from interface: ISessionOperation
Executes the operation to process an event of a session-based charging scenario.

Specified by:
execute in interface ISessionOperation
Returns:
The result to be handled
Throws:
ServerFailureException - thrown if operation execution fails on server side
java.lang.IllegalArgumentException - thrown if operation is not correctly configured
CommunicationFailureException - thrown if operation execution fails on client side
ForbiddenChargeException - thrown if the guiding data does not correspond to a valid accessible charge
SessionOperationException - thrown if an error such as session does not exist or session already exists is raised

enqueue

protected void enqueue(SessionChargingOperation.SessionChargingOperationItem item)

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