Change log:

Date:

Author:

Version:

Changes:

Completed

Ext.

Int.

Is in Core

Jira Ref.

11 September 2012

Antoni Piotr Oleksicki

1.0

Doc. created

Yes

x

 

N/A

 

Summary

Rollover bundles are used to enable transfer of some of the remaining free units from one period to an another later subsequent period. The purpose of this document is to describe how this functionality is implemented as a part of the core project.

Rollover Concept

Rollover means is the term to describe that some part of the free units from one SubscriptionBundle which have not been used spent in one period, can be used later on by an another later subsequent SubscriptionBundle. The amount to be 'rolled over' to another bundle can also be called "surplus"referred to as a 'surplus. The Rollover can be described with four parameters:

  1. Maximum rollover amount per SubscriptionBundle - how much can be transferred from one period to another.
  2. Rollover validity\Rollover period length - For for how long is the rollover valid, i.e. how many periods from the past can be used.
  3. Rollover usage mode - In in use, should free units first be subtracted from surplus or from the current SubscriptionBundle.
  4. Internal order of the surplus - Are are the 'newer' or 'older' free units used first.

Design and

...

Implementation

The starting point of the design was the fact, that a subscription bundle has to work in two contexts:

...

  • getMaxSurplus - returns the maximum amount of units that can be transferred as surplus from a SubscriptionBundle,
  • getSurplusPeriodOrder - returns one of the values of SurplusPeriodOrder, which indicates whether SubscriptionBundle used for surplus should be ordered from newer to older units, or the other way aroundround,
  • getSurplusUsageMode - returns one of the values of SurplusUsageMode and is used to define, whether surplus should be used before or after SubscriptionBundle,
  • getAmountOfRolloverPeriods - returns an amount (integer value) of previous periods from which surplus can be used
  • SurplusPeriodOrder - an enum with two values: NEWER_FIRST and OLDER_FIRST used by getSurplusPeriodOrder,
  • SurplusUsageMode - an enum with two values: USE_ROLLOVER_BEFORE_BUNDLE and USE_ROLLOVER_AFTER_BUNDLE used by getSurplusUsageMode,
    Currently, the only bundles that implement the RolloverBundle interface is RestrictActive and PostRatingBundleV2.

One thing is worth pointing out: a new method, for calculating the amount of free units on a SubscriptionBundle, has been introduced on the Bundle_ class. It is called getFreeUnits. This was done, because the classical VALUE_1 - VALUE_2 is no longer valid, when surplus is used. The update manager now has this responsibility.

...