public class SessionChargingOperation extends Object implements ISessionStartChargingAsyncOperation, ISessionStopChargingAsyncOperation, ISessionUpdateChargingAsyncOperation, ISessionStartChargingOperation, ISessionUpdateChargingOperation, ISessionStopChargingOperation
Java class represents
a multiservice session operation request that is sent
to the connected SAP CC system to manage session-based charging services.| Modifier and Type | Class and Description |
|---|---|
static class |
SessionChargingOperation.SessionChargingOperationType
FOR INTERNAL USE ONLY - This
enumeration lists the types of operations: START, UPDATE, and STOP. |
ISessionDefaultAttributeHolder.TransactionSelectionCriteriaISessionReservation.SessionReservationResolution| Constructor and Description |
|---|
SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType,
String sessionId,
String userServiceId,
String serviceId,
Date consumptionDate)
Builds a new
SessionChargingOperation |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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. |
String |
getServiceId()
Returns the service ID (SID): a technical ID for the customer service of a service provider
|
String |
getSessionId()
Returns the multiservice session identifier.
|
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(String reservationId)
This
method allows you to cancel a reservation during a session-based charging. |
void |
prepareConfirm(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(String reservationId,
ChargeableItem confirmationItem,
ChargeableItem reservationItem)
This
method allows you to confirm and extend a reservation during a session-based charging. |
void |
prepareReserve(String reservationId,
ChargeableItem reservationItem,
ISessionReservation.SessionReservationResolution defaultResolution,
long ttl,
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. |
public SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType, String sessionId, String userServiceId, String serviceId, Date consumptionDate)
SessionChargingOperationopType - the operation typesessionId - the session identifier which has to be uniqueuserServiceId - the user service identifier (USID), which represents a technical identifier of the end customer consuming the serviceserviceId - the service identifier (SID), which represents a technical identifier of the service provided by the service providerconsumptionDate - the date the service was consumed by the end customer (this date is used as a consumption date for reservations)public String getSessionId()
public String getUserServiceId()
public String getServiceId()
public Date getConsumptionDate()
public void setResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria rt)
ISessionDefaultAttributeHolder.TransactionSelectionCriteria.ALL_TRANSACTION.setResultType in interface ISessionDefaultAttributeHolderrt - The selection criteria for the returned transactionspublic ISessionDefaultAttributeHolder.TransactionSelectionCriteria getResultType()
ISessionDefaultAttributeHoldertransactions.getResultType in interface ISessionDefaultAttributeHolderpublic ISessionDefaultAttributeHolder.TransactionSelectionCriteria getCleanUpResultType()
getCleanUpResultType in interface ISessionDefaultAttributeHolderpublic void setCleanUpResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria cleanUpResultType)
setCleanUpResultType in interface ISessionDefaultAttributeHoldercleanUpResultType - The cleanUpResultType to setpublic void setFilterTransaction(boolean ft)
ISessionDefaultAttributeHoldertransactions have to be filteredsetFilterTransaction in interface ISessionDefaultAttributeHolderft - true if transactions must be filtered, false otherwisepublic boolean isFilterTransaction()
ISessionDefaultAttributeHoldertransactions are filteredisFilterTransaction in interface ISessionDefaultAttributeHoldertrue if transactions are filtered, false otherwisepublic SessionChargingOperation.SessionChargingOperationType getOpType()
public void setReservationRenewalListenerId(byte rrlId)
throws IllegalArgumentException
IReservationRenewalListenerIdSettable0 is kept for unset values.setReservationRenewalListenerId in interface IReservationRenewalListenerIdSettablerrlId - The registration identifier of the reservation renewal listener (RRL)IllegalArgumentException - when the value is not an unsigned byte between 1 and 127public void setExternalData(byte[] externalData)
IExternalDataSettableNote
External data must not be null but it can be empty.
setExternalData in interface IExternalDataSettableexternalData - The external datapublic void prepareReserve(String reservationId, ChargeableItem reservationItem, ISessionReservation.SessionReservationResolution defaultResolution, long ttl, String propertyToInverse)
ISessionReservationmethod 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.
prepareReserve in interface ISessionReservationreservationId - The reservation identifier that must be unique within a sessionreservationItem - The mandatory chargeable item that includes the service consumption informationdefaultResolution - 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 secondspropertyToInverse - The name of the property in the reservationItem to inverse in case of best effort reservationpublic void prepareConfirm(String reservationId, ChargeableItem confirmationItem)
ISessionConfirmationmethod 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.
prepareConfirm in interface ISessionConfirmationreservationId - 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.public void prepareCancel(String reservationId)
ISessionConfirmationmethod 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.
prepareCancel in interface ISessionConfirmationreservationId - The reservation identifier that must be unique within a multiservice session;
This ID identifies a charging session.public void prepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem)
ISessionConfirmAndReservemethod 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.
prepareConfirmAndReserve in interface ISessionConfirmAndReservereservationId - The reservation identifier that must be unique within a sessionconfirmationItem - The confirmation item (optional, null, or partially defined items are accepted)reservationItem - The reservation item (optional, null, or partially defined items are accepted)public void execute(ISessionResultListener listener)
ISessionAsyncOperationexecute in interface ISessionAsyncOperationlistener - The listener responsible for processing the results or exceptions of this operation requestpublic ISessionOperationResult execute() throws ServerFailureException, IllegalArgumentException, CommunicationFailureException, ForbiddenChargeException, SessionOperationException
ISessionOperationexecute in interface ISessionOperationresult to be handledServerFailureException - thrown if operation execution fails on server sideIllegalArgumentException - thrown if operation is not correctly configuredCommunicationFailureException - thrown if operation execution fails on client sideForbiddenChargeException - thrown if the guiding data does not correspond to a valid accessible chargeSessionOperationException - thrown if an error such as session does not exist or session already exists is raised