Interface SubscriptionApi

  • All Superinterfaces:
    KillbillApi

    public interface SubscriptionApi
    extends KillbillApi
    API to manage the retrieval of Subscription information.
    • Method Detail

      • getSubscriptionForEntitlementId

        Subscription getSubscriptionForEntitlementId​(UUID entitlementId,
                                                     boolean includeDeletedEvents,
                                                     TenantContext context)
                                              throws SubscriptionApiException
        Retrieves a Subscription for the entitlement id
        Parameters:
        entitlementId - the id of the entitlement associated with the subscription
        includeDeletedEvents - flag that specifies whether deleted events should be returned
        context - the context
        Returns:
        the subscription
        Throws:
        SubscriptionApiException - if it odes not exist
      • getSubscriptionForExternalKey

        Subscription getSubscriptionForExternalKey​(String externalKey,
                                                   boolean includeDeletedEvents,
                                                   TenantContext context)
                                            throws SubscriptionApiException
        Retrieves a Subscription for a given external key
        Parameters:
        externalKey - the external key for the subscription
        includeDeletedEvents - flag that specifies whether deleted events should be returned
        context -
        Returns:
        Throws:
        SubscriptionApiException
      • getSubscriptionBundlesForAccountIdAndExternalKey

        List<SubscriptionBundle> getSubscriptionBundlesForAccountIdAndExternalKey​(UUID accountId,
                                                                                  String externalKey,
                                                                                  TenantContext context)
                                                                           throws SubscriptionApiException
        Retrieves all the SubscriptionBundle for a given account and matching an external key.
        Parameters:
        accountId - the account id
        externalKey - the external key
        context - the context
        Returns:
        a SubscriptionBundle
        Throws:
        SubscriptionApiException - if there is n o such object matching the account and external key
      • getActiveSubscriptionBundleForExternalKey

        SubscriptionBundle getActiveSubscriptionBundleForExternalKey​(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.
        Parameters:
        externalKey - the external key
        context - the context
        Returns:
        a SubscriptionBundle
        Throws:
        SubscriptionApiException - if there is no such object
      • getSubscriptionBundles

        Pagination<SubscriptionBundle> getSubscriptionBundles​(Long offset,
                                                              Long limit,
                                                              TenantContext context)
        Parameters:
        context - the user context
        offset - the offset of the first result
        limit - the maximum number of results to retrieve
        Returns:
        the list of SubscriptionBundle for that tenant
      • searchSubscriptionBundles

        Pagination<SubscriptionBundle> searchSubscriptionBundles​(String searchKey,
                                                                 Long offset,
                                                                 Long limit,
                                                                 TenantContext context)
        Find all SubscriptionBundle having their id, account id or external key matching the search key
        Parameters:
        searchKey - the search key
        offset - the offset of the first result
        limit - the maximum number of results to retrieve
        context - the user context
        Returns:
        the list of SubscriptionBundle matching this search key for that tenant
      • addBlockingState

        void addBlockingState​(BlockingState blockingState,
                              org.joda.time.LocalDate effectiveDate,
                              Iterable<PluginProperty> properties,
                              CallContext context)
                       throws EntitlementApiException
        Add a BlockingState

        The date is interpreted by the system to be in the timezone specified at the Account

        Parameters:
        blockingState - the blockingState to be added
        effectiveDate - the date in the account time zone at which the operation should be effective, if null this is interpreted to be immediate
        properties - plugin specific properties
        context - the context
        Throws:
        EntitlementApiException - if the entitlement was not in ACTIVE state
      • addBlockingState

        void addBlockingState​(BlockingState blockingState,
                              org.joda.time.DateTime effectiveDate,
                              Iterable<PluginProperty> properties,
                              CallContext context)
                       throws EntitlementApiException
        Add a BlockingState

        The date is interpreted by the system to be in the timezone specified at the Account

        Parameters:
        blockingState - the blockingState to be added
        effectiveDate - the datetime at which the operation should be effective, if null this is interpreted to be immediate
        properties - plugin specific properties
        context - the context
        Throws:
        EntitlementApiException - if the entitlement was not in ACTIVE state
      • getBlockingStates

        Iterable<BlockingState> getBlockingStates​(UUID accountId,
                                                  List<BlockingStateType> typeFilter,
                                                  List<String> svcsFilter,
                                                  OrderingType orderingType,
                                                  int timeFilter,
                                                  TenantContext context)
                                           throws EntitlementApiException
        Parameters:
        accountId - the account id
        typeFilter - the list of BlockingStateType filters. All types are returned if null or empty.
        svcsFilter - the list of service filters. All services are returned if null or empty.
        orderingType - the ordering direction, that is ASCENDING or DESCENDING
        timeFilter - the filtering types constructed as a bitwise operation
        context - the user context
        Returns:
        the ordered list of BlockingState
        Throws:
        EntitlementApiException - if the account is invalid.
      • getSubscriptionBundleAuditLogsWithHistoryForId

        List<AuditLogWithHistory> getSubscriptionBundleAuditLogsWithHistoryForId​(UUID bundleId,
                                                                                 AuditLevel auditLevel,
                                                                                 TenantContext context)
        Get all the audit entries with history for a given bundle.
        Parameters:
        bundleId - the bundleId id
        auditLevel - audit level (verbosity)
        context - the tenant context
        Returns:
        all audit entries with history for a bundle
      • getSubscriptionAuditLogsWithHistoryForId

        List<AuditLogWithHistory> getSubscriptionAuditLogsWithHistoryForId​(UUID entitlementId,
                                                                           AuditLevel auditLevel,
                                                                           TenantContext context)
        Get all the audit entries with history for a given subscription.
        Parameters:
        entitlementId - the entitlementId id
        auditLevel - audit level (verbosity)
        context - the tenant context
        Returns:
        all audit entries with history for a subscription
      • getSubscriptionEventAuditLogsWithHistoryForId

        List<AuditLogWithHistory> getSubscriptionEventAuditLogsWithHistoryForId​(UUID EventId,
                                                                                AuditLevel auditLevel,
                                                                                TenantContext context)
        Get all the audit entries with history for a given subscription event.
        Parameters:
        EventId - the subscription event id
        auditLevel - audit level (verbosity)
        context - the tenant context
        Returns:
        all audit entries with history for a subscription event
      • getBlockingStateAuditLogsWithHistoryForId

        List<AuditLogWithHistory> getBlockingStateAuditLogsWithHistoryForId​(UUID blockingId,
                                                                            AuditLevel auditLevel,
                                                                            TenantContext context)
        Get all the audit entries with history for a given blocking state.
        Parameters:
        blockingId - the blocking id
        auditLevel - audit level (verbosity)
        context - the tenant context
        Returns:
        all audit entries with history for a blocking state