![JAR search and dependency download from the Maven repository](/logo.png)
com.ning.billing.entitlement.api.SubscriptionApi Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2010-2013 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.ning.billing.entitlement.api;
import java.util.List;
import java.util.UUID;
import com.ning.billing.util.callcontext.CallContext;
import com.ning.billing.util.callcontext.TenantContext;
import com.ning.billing.util.entity.Pagination;
/**
* API to manage the retrieval of Subscription
information.
*/
public interface SubscriptionApi {
/**
* Retrieves a Subscription
For the entitlementId
*
* @param entitlementId the id of the entitlement associated with the subscription
* @param context the context
* @return the subscription
* @throws SubscriptionApiException if it odes not exist
*/
Subscription getSubscriptionForEntitlementId(UUID entitlementId, TenantContext context) throws SubscriptionApiException;
/**
* Retrieves all the Subscription
attached to the base entitlement.
*
* @param bundleId the id of the bundle
* @param context the context
* @return a list of subscriptions
* @throws SubscriptionApiException if the baseEntitlementId does not exist.
*/
public SubscriptionBundle getSubscriptionBundle(UUID bundleId, TenantContext context) throws SubscriptionApiException;
/**
* Update the externalKey for a given bundle
*
* @param bundleId ; bundle id
* @param newExternalKey : the new value for the externalKey
* @param context : the call context
*/
public void updateExternalKey(UUID bundleId, String newExternalKey, CallContext context);
/**
* Retrieves all the SubscriptionBundle
for a given account and matching an external key.
*
* @param accountId the account id
* @param externalKey the external key
* @param context the context
* @return a SubscriptionBundle
* @throws SubscriptionApiException if there is n o such object matching the account and external key
*/
public List getSubscriptionBundlesForAccountIdAndExternalKey(UUID accountId, String externalKey, TenantContext context) throws SubscriptionApiException;
/**
* Retrieves all the SubscriptionBundle
for the given external key.
*
* It is possible to have multiple SubscriptionBundle
for a given external key in the system but only one
* will be active -- i.e. will contain Subscription
in the active state.
*
* @param externalKey the external key
* @param context the context
* @return a SubscriptionBundle
* @throws SubscriptionApiException if there is no such object
*/
public SubscriptionBundle getActiveSubscriptionBundleForExternalKey(String externalKey, TenantContext context) throws SubscriptionApiException;
/**
* Returns an ordered list of all SubscriptionBundle
for a given external key.
*
* @return
*/
public List getSubscriptionBundlesForExternalKey(String externalKey, TenantContext context) throws SubscriptionApiException;
/**
* Retrieves all the SubscriptionBundle
for a given account.
*
* @param accountId the account id
* @param context the context
* @return list of SubscriptionBundle
* @throws SubscriptionApiException if the account does not exist
*/
public List getSubscriptionBundlesForAccountId(UUID accountId, TenantContext context) throws SubscriptionApiException;
/**
* @param context the user context
* @param offset the offset of the first result
* @param limit the maximum number of results to retrieve
* @return the list of SubscriptionBundle
for that tenant
*/
public Pagination getSubscriptionBundles(Long offset, Long limit, TenantContext context);
/**
* Find all SubscriptionBundle
having their id, account id or external key matching the search key
*
* @param searchKey the search key
* @param offset the offset of the first result
* @param limit the maximum number of results to retrieve
* @param context the user context
* @return the list of SubscriptionBundle
matching this search key for that tenant
*/
public Pagination searchSubscriptionBundles(String searchKey, Long offset, Long limit, TenantContext context);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy