Class SessionChargingOperation
- All Implemented Interfaces:
IExternalDataSettable,IReservationRenewalListenerIdSettable,ISessionAsyncOperation,ISessionConfirmAndReserve,ISessionConfirmation,ISessionDefaultAttributeHolder,ISessionOperation,ISessionReservation,ISessionStartChargingAsyncOperation,ISessionStartChargingOperation,ISessionStopChargingAsyncOperation,ISessionStopChargingOperation,ISessionUpdateChargingAsyncOperation,ISessionUpdateChargingOperation
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
Nested ClassesModifier and TypeClassDescriptionstatic enumFOR INTERNAL USE ONLY - Thisenumerationlists the types of operations: START, UPDATE, and STOP.Nested classes/interfaces inherited from interface com.highdeal.cnd.message.ISessionDefaultAttributeHolder
ISessionDefaultAttributeHolder.TransactionSelectionCriteriaNested classes/interfaces inherited from interface com.highdeal.cnd.message.ISessionReservation
ISessionReservation.SessionReservationResolution -
Constructor Summary
ConstructorsConstructorDescriptionSessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType, String sessionId, String userServiceId, String serviceId, Date consumptionDate) Builds a newSessionChargingOperation -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the operation to process an event of a session-based charging scenario.voidexecute(ISessionResultListener listener) Executes the operation to process an event of a session-based charging scenario.Returns the cleanUpResultType.Returns the consumption date.Returns the type of session-based charging operation: start, update, or stop.Indicates the selection criteria for the returnedtransactions.Returns the service ID (SID): a technical ID for the customer service of a service providerReturns the multiservice session identifier.Returns the user service ID (USID): a technical ID for the end customer who uses (consumes) a customer service of a service providerbooleanIndicates whether or not returnedtransactionsare filteredvoidprepareCancel(String reservationId) Thismethodallows you to cancel a reservation during a session-based charging.voidprepareConfirm(String reservationId, ChargeableItem confirmationItem) Thismethodallows you to confirm a reservation in a charging session included in a multiservice session (or customer session).voidprepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem) Thismethodallows you to confirm and extend a reservation during a session-based charging.voidprepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem, long ttl) Thismethodallows you to confirm and extend a reservation during a session-based charging.voidprepareReserve(String reservationId, ChargeableItem reservationItem, ISessionReservation.SessionReservationResolution defaultResolution, long ttl, String propertyToInverse) Thismethodallows you to create a reservation request during session-based charging operations.voidsetCleanUpResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria cleanUpResultType) Specifies the cleanUp result Type to the value of cleanUpResultType.voidsetExternalData(byte[] externalData) Sets the external data that is included in the renew reservation notifications by the connected SAP CC system.voidsetFilterTransaction(boolean ft) Defines whether or not returnedtransactionshave to be filteredvoidsetReservationRenewalListenerId(byte rrlId) Sets the identifier of the reservation renewal listener (RRL).voidSpecifies the selection criteria for the returned transactions:ISessionDefaultAttributeHolder.TransactionSelectionCriteria.ALL_TRANSACTION.
-
Constructor Details
-
SessionChargingOperation
public SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType, String sessionId, String userServiceId, String serviceId, Date consumptionDate) Builds a newSessionChargingOperation- Parameters:
opType- 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)
-
-
Method Details
-
getSessionId
Returns the multiservice session identifier.- Returns:
- The multiservice session ID
-
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
Returns the service ID (SID): a technical ID for the customer service of a service provider- Returns:
- The SID
-
getConsumptionDate
Returns the consumption date.- Returns:
- The consumption date
-
setResultType
Specifies the selection criteria for the returned transactions:ISessionDefaultAttributeHolder.TransactionSelectionCriteria.ALL_TRANSACTION.- Specified by:
setResultTypein interfaceISessionDefaultAttributeHolder- Parameters:
rt- The selection criteria for the returned transactions
-
getResultType
Description copied from interface:ISessionDefaultAttributeHolderIndicates the selection criteria for the returnedtransactions.- Specified by:
getResultTypein interfaceISessionDefaultAttributeHolder- Returns:
- The selection criteria for the returned transactions
-
getCleanUpResultType
Returns the cleanUpResultType.- Specified by:
getCleanUpResultTypein interfaceISessionDefaultAttributeHolder- Returns:
- The cleanUp result type
-
setCleanUpResultType
public void setCleanUpResultType(ISessionDefaultAttributeHolder.TransactionSelectionCriteria cleanUpResultType) Specifies the cleanUp result Type to the value of cleanUpResultType.- Specified by:
setCleanUpResultTypein interfaceISessionDefaultAttributeHolder- Parameters:
cleanUpResultType- The cleanUpResultType to set
-
setFilterTransaction
public void setFilterTransaction(boolean ft) Description copied from interface:ISessionDefaultAttributeHolderDefines whether or not returnedtransactionshave to be filtered- Specified by:
setFilterTransactionin interfaceISessionDefaultAttributeHolder- Parameters:
ft-trueif transactions must be filtered,falseotherwise
-
isFilterTransaction
public boolean isFilterTransaction()Description copied from interface:ISessionDefaultAttributeHolderIndicates whether or not returnedtransactionsare filtered- Specified by:
isFilterTransactionin interfaceISessionDefaultAttributeHolder- Returns:
trueif transactions are filtered,falseotherwise
-
getOpType
Returns the type of session-based charging operation: start, update, or stop.- Returns:
- The operation type
-
setReservationRenewalListenerId
Description copied from interface:IReservationRenewalListenerIdSettableSets the identifier of the reservation renewal listener (RRL). The identifier is an unsigned byte between 1 and 127. The value0is kept for unset values.- Specified by:
setReservationRenewalListenerIdin interfaceIReservationRenewalListenerIdSettable- Parameters:
rrlId- The registration identifier of the reservation renewal listener (RRL)- Throws:
IllegalArgumentException- when the value is not an unsigned byte between 1 and 127
-
setExternalData
public void setExternalData(byte[] externalData) Description copied from interface:IExternalDataSettableSets 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
nullbut it can be empty.- Specified by:
setExternalDatain interfaceIExternalDataSettable- Parameters:
externalData- The external data
-
prepareReserve
public void prepareReserve(String reservationId, ChargeableItem reservationItem, ISessionReservation.SessionReservationResolution defaultResolution, long ttl, String propertyToInverse) Description copied from interface:ISessionReservationThismethodallows 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 itemby 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
ttlanddefaultResolutionto 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:
prepareReservein interfaceISessionReservation- Parameters:
reservationId- 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.CANCELLEDorISessionReservation.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 reservation
-
prepareConfirm
Description copied from interface:ISessionConfirmationThismethodallows 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 clientto 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 confirmationusing 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:
prepareConfirmin interfaceISessionConfirmation- 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
Description copied from interface:ISessionConfirmationThismethodallows 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:
prepareCancelin interfaceISessionConfirmation- Parameters:
reservationId- The reservation identifier that must be unique within a multiservice session; This ID identifies a charging session.
-
prepareConfirmAndReserve
public void prepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem) Description copied from interface:ISessionConfirmAndReserveThismethodallows 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:
prepareConfirmAndReservein interfaceISessionConfirmAndReserve- Parameters:
reservationId- 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)
-
prepareConfirmAndReserve
public void prepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem, long ttl) Description copied from interface:ISessionConfirmAndReserveThismethodallows 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:
prepareConfirmAndReservein interfaceISessionConfirmAndReserve- Parameters:
reservationId- 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)ttl- The time to live (TTL) expressed in seconds (negative value means that TTL of the previous reservation is kept)
-
execute
Description copied from interface:ISessionAsyncOperationExecutes the operation to process an event of a session-based charging scenario.- Specified by:
executein interfaceISessionAsyncOperation- Parameters:
listener- The listener responsible for processing the results or exceptions of this operation request
-
execute
public ISessionOperationResult execute() throws ServerFailureException, IllegalArgumentException, CommunicationFailureException, ForbiddenChargeException, SessionOperationExceptionDescription copied from interface:ISessionOperationExecutes the operation to process an event of a session-based charging scenario.- Specified by:
executein interfaceISessionOperation- Returns:
- The
resultto be handled - Throws:
ServerFailureException- 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
-