com.ning.billing.subscription.api.svcs
Class DefaultSubscriptionInternalApi

java.lang.Object
  extended by com.ning.billing.subscription.api.SubscriptionApiBase
      extended by com.ning.billing.subscription.api.svcs.DefaultSubscriptionInternalApi
All Implemented Interfaces:
SubscriptionBaseInternalApi

public class DefaultSubscriptionInternalApi
extends SubscriptionApiBase
implements SubscriptionBaseInternalApi


Field Summary
 
Fields inherited from class com.ning.billing.subscription.api.SubscriptionApiBase
apiService, catalogService, clock, dao
 
Constructor Summary
DefaultSubscriptionInternalApi(SubscriptionDao dao, DefaultSubscriptionBaseApiService apiService, com.ning.billing.clock.Clock clock, CatalogService catalogService, AddonUtils addonUtils)
           
 
Method Summary
 SubscriptionBaseBundle createBundleForAccount(UUID accountId, String bundleKey, InternalCallContext context)
           
 SubscriptionBase createSubscription(UUID bundleId, PlanPhaseSpecifier spec, org.joda.time.DateTime requestedDateWithMs, InternalCallContext context)
           
 UUID getAccountIdFromSubscriptionId(UUID subscriptionId, InternalTenantContext context)
           
 SubscriptionBaseBundle getActiveBundleForKey(String bundleKey, InternalTenantContext context)
           
 List<EffectiveSubscriptionInternalEvent> getAllTransitions(SubscriptionBase subscription, InternalTenantContext context)
           
 SubscriptionBase getBaseSubscription(UUID bundleId, InternalTenantContext context)
           
 List<EffectiveSubscriptionInternalEvent> getBillingTransitions(SubscriptionBase subscription, InternalTenantContext context)
           
 SubscriptionBaseBundle getBundleForAccountAndKey(UUID accountId, String bundleKey, InternalTenantContext context)
           
 SubscriptionBaseBundle getBundleFromId(UUID id, InternalTenantContext context)
           
 List<SubscriptionBaseBundle> getBundlesForAccount(UUID accountId, InternalTenantContext context)
           
 List<SubscriptionBaseBundle> getBundlesForKey(String bundleKey, InternalTenantContext context)
           
 List<com.ning.billing.entitlement.api.EntitlementAOStatusDryRun> getDryRunChangePlanStatus(UUID subscriptionId, String baseProductName, org.joda.time.DateTime requestedDate, InternalTenantContext context)
           
 org.joda.time.DateTime getNextBillingDate(UUID accountId, InternalTenantContext context)
           
 SubscriptionBase getSubscriptionFromId(UUID id, InternalTenantContext context)
           
 List<SubscriptionBase> getSubscriptionsForBundle(UUID bundleId, InternalTenantContext context)
           
 void setChargedThroughDate(UUID subscriptionId, org.joda.time.DateTime chargedThruDate, InternalCallContext context)
           
 
Methods inherited from class com.ning.billing.subscription.api.SubscriptionApiBase
createSubscriptionForApiUse, createSubscriptionForApiUse, createSubscriptionsForApiUse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSubscriptionInternalApi

@Inject
public DefaultSubscriptionInternalApi(SubscriptionDao dao,
                                             DefaultSubscriptionBaseApiService apiService,
                                             com.ning.billing.clock.Clock clock,
                                             CatalogService catalogService,
                                             AddonUtils addonUtils)
Method Detail

createSubscription

public SubscriptionBase createSubscription(UUID bundleId,
                                           PlanPhaseSpecifier spec,
                                           org.joda.time.DateTime requestedDateWithMs,
                                           InternalCallContext context)
                                    throws SubscriptionBaseApiException
Specified by:
createSubscription in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

createBundleForAccount

public SubscriptionBaseBundle createBundleForAccount(UUID accountId,
                                                     String bundleKey,
                                                     InternalCallContext context)
                                              throws SubscriptionBaseApiException
Specified by:
createBundleForAccount in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getBundleForAccountAndKey

public SubscriptionBaseBundle getBundleForAccountAndKey(UUID accountId,
                                                        String bundleKey,
                                                        InternalTenantContext context)
                                                 throws SubscriptionBaseApiException
Specified by:
getBundleForAccountAndKey in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getBundlesForAccount

public List<SubscriptionBaseBundle> getBundlesForAccount(UUID accountId,
                                                         InternalTenantContext context)
Specified by:
getBundlesForAccount in interface SubscriptionBaseInternalApi

getBundlesForKey

public List<SubscriptionBaseBundle> getBundlesForKey(String bundleKey,
                                                     InternalTenantContext context)
Specified by:
getBundlesForKey in interface SubscriptionBaseInternalApi

getActiveBundleForKey

public SubscriptionBaseBundle getActiveBundleForKey(String bundleKey,
                                                    InternalTenantContext context)
                                             throws SubscriptionBaseApiException
Specified by:
getActiveBundleForKey in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getSubscriptionsForBundle

public List<SubscriptionBase> getSubscriptionsForBundle(UUID bundleId,
                                                        InternalTenantContext context)
Specified by:
getSubscriptionsForBundle in interface SubscriptionBaseInternalApi

getBaseSubscription

public SubscriptionBase getBaseSubscription(UUID bundleId,
                                            InternalTenantContext context)
                                     throws SubscriptionBaseApiException
Specified by:
getBaseSubscription in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getSubscriptionFromId

public SubscriptionBase getSubscriptionFromId(UUID id,
                                              InternalTenantContext context)
                                       throws SubscriptionBaseApiException
Specified by:
getSubscriptionFromId in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getBundleFromId

public SubscriptionBaseBundle getBundleFromId(UUID id,
                                              InternalTenantContext context)
                                       throws SubscriptionBaseApiException
Specified by:
getBundleFromId in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

getAccountIdFromSubscriptionId

public UUID getAccountIdFromSubscriptionId(UUID subscriptionId,
                                           InternalTenantContext context)
                                    throws SubscriptionBaseApiException
Specified by:
getAccountIdFromSubscriptionId in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException

setChargedThroughDate

public void setChargedThroughDate(UUID subscriptionId,
                                  org.joda.time.DateTime chargedThruDate,
                                  InternalCallContext context)
Specified by:
setChargedThroughDate in interface SubscriptionBaseInternalApi

getAllTransitions

public List<EffectiveSubscriptionInternalEvent> getAllTransitions(SubscriptionBase subscription,
                                                                  InternalTenantContext context)
Specified by:
getAllTransitions in interface SubscriptionBaseInternalApi

getBillingTransitions

public List<EffectiveSubscriptionInternalEvent> getBillingTransitions(SubscriptionBase subscription,
                                                                      InternalTenantContext context)
Specified by:
getBillingTransitions in interface SubscriptionBaseInternalApi

getNextBillingDate

public org.joda.time.DateTime getNextBillingDate(UUID accountId,
                                                 InternalTenantContext context)
Specified by:
getNextBillingDate in interface SubscriptionBaseInternalApi

getDryRunChangePlanStatus

public List<com.ning.billing.entitlement.api.EntitlementAOStatusDryRun> getDryRunChangePlanStatus(UUID subscriptionId,
                                                                                                  @Nullable
                                                                                                  String baseProductName,
                                                                                                  org.joda.time.DateTime requestedDate,
                                                                                                  InternalTenantContext context)
                                                                                           throws SubscriptionBaseApiException
Specified by:
getDryRunChangePlanStatus in interface SubscriptionBaseInternalApi
Throws:
SubscriptionBaseApiException


Copyright © 2010-2013. All Rights Reserved.