Class SessionChargingOperation

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

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.
  • Constructor Details

    • SessionChargingOperation

      public SessionChargingOperation(SessionChargingOperation.SessionChargingOperationType opType, String sessionId, String userServiceId, String serviceId, Date consumptionDate)
      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 Details

    • getSessionId

      public String getSessionId()
      Returns the multiservice session identifier.
      Returns:
      The multiservice session ID
    • getUserServiceId

      public 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 String getServiceId()
      Returns the service ID (SID): a technical ID for the customer service of a service provider
      Returns:
      The SID
    • getConsumptionDate

      public Date getConsumptionDate()
      Returns the consumption date.
      Returns:
      The consumption date
    • setResultType

      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

      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

      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

      Returns the type of session-based charging operation: start, update, or stop.
      Returns:
      The operation type
    • setReservationRenewalListenerId

      public void setReservationRenewalListenerId(byte rrlId) throws 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:
      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(String reservationId, ChargeableItem reservationItem, ISessionReservation.SessionReservationResolution defaultResolution, long ttl, 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(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(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(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)
    • prepareConfirmAndReserve

      public void prepareConfirmAndReserve(String reservationId, ChargeableItem confirmationItem, ChargeableItem reservationItem, long ttl)
      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)
      ttl - The time to live (TTL) expressed in seconds (negative value means that TTL of the previous reservation is kept)
    • 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

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