|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.billing.subscription.alignment.BaseAligner
com.ning.billing.subscription.alignment.PlanAligner
public class PlanAligner
PlanAligner offers specific APIs to return the correct TimedPhase when creating, changing Plan or to compute
next Phase on current Plan.
| Constructor Summary | |
|---|---|
PlanAligner(CatalogService catalogService)
|
|
| Method Summary | |
|---|---|
TimedPhase[] |
getCurrentAndNextTimedPhaseOnCreate(DefaultSubscriptionBase subscription,
Plan plan,
PhaseType initialPhase,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
Returns the current and next phase for the subscription in creation |
TimedPhase |
getCurrentTimedPhaseOnChange(DefaultSubscriptionBase subscription,
Plan plan,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
Returns current Phase for that Plan change |
TimedPhase |
getNextTimedPhase(DefaultSubscriptionBase subscription,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
Returns next Phase for that SubscriptionBase at a point in time |
TimedPhase |
getNextTimedPhaseOnChange(DefaultSubscriptionBase subscription,
Plan plan,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
Returns next Phase for that Plan change |
| Methods inherited from class com.ning.billing.subscription.alignment.BaseAligner |
|---|
addDuration, removeDuration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public PlanAligner(CatalogService catalogService)
| Method Detail |
|---|
public TimedPhase[] getCurrentAndNextTimedPhaseOnCreate(DefaultSubscriptionBase subscription,
Plan plan,
PhaseType initialPhase,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
throws CatalogApiException,
SubscriptionBaseApiException
subscription - the subscription in creation (only the start date and the bundle start date are looked at)plan - the current PlaninitialPhase - the initialPhase on which we should create that subscription. can be nullpriceList - the priceListrequestedDate - the requested date (only used to load the catalog)effectiveDate - the effective creation date (driven by the catalog policy, i.e. when the creation occurs)
CatalogApiException - for catalog errors
SubscriptionBaseApiException - for subscription errors
public TimedPhase getCurrentTimedPhaseOnChange(DefaultSubscriptionBase subscription,
Plan plan,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
throws CatalogApiException,
SubscriptionBaseApiException
subscription - the subscription in change (only start date, bundle start date, current phase, plan and pricelist
are looked at)plan - the current PlanpriceList - the priceList on which we should change that subscription.requestedDate - the requested dateeffectiveDate - the effective change date (driven by the catalog policy, i.e. when the change occurs)
CatalogApiException - for catalog errors
SubscriptionBaseApiException - for subscription errors
public TimedPhase getNextTimedPhaseOnChange(DefaultSubscriptionBase subscription,
Plan plan,
String priceList,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
throws CatalogApiException,
SubscriptionBaseApiException
subscription - the subscription in change (only start date, bundle start date, current phase, plan and pricelist
are looked at)plan - the current PlanpriceList - the priceList on which we should change that subscription.requestedDate - the requested dateeffectiveDate - the effective change date (driven by the catalog policy, i.e. when the change occurs)
CatalogApiException - for catalog errors
SubscriptionBaseApiException - for subscription errors
public TimedPhase getNextTimedPhase(DefaultSubscriptionBase subscription,
org.joda.time.DateTime requestedDate,
org.joda.time.DateTime effectiveDate)
subscription - the subscription for which we need to compute the next Phase eventrequestedDate - the requested dateeffectiveDate - the date at which we look to compute that event. effective needs to be after last Plan change or initial Plan
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||