Tabnine Logo
SubscriptionApiException
Code IndexAdd Tabnine to your IDE (free)

How to use
SubscriptionApiException
in
org.killbill.billing.entitlement.api

Best Java code snippets using org.killbill.billing.entitlement.api.SubscriptionApiException (Showing top 7 results out of 315)

origin: killbill/killbill

@Override
protected SubscriptionApiException generateAlreadyExistsException(final SubscriptionBundleModelDao entity, final InternalCallContext context) {
  return new SubscriptionApiException(ErrorCode.SUB_CREATE_ACTIVE_BUNDLE_KEY_EXISTS, entity.getExternalKey());
}
origin: org.kill-bill.billing/killbill-jaxrs

@Override
public Response toResponse(final SubscriptionApiException exception) {
  if (exception.getCode() == ErrorCode.SUB_ACCOUNT_IS_OVERDUE_BLOCKED.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_BUNDLE_IS_OVERDUE_BLOCKED.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CANCEL_BAD_STATE.getCode()) {
    return buildInternalErrorResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CHANGE_DRY_RUN_NOT_BP.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CHANGE_FUTURE_CANCELLED.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CHANGE_NON_ACTIVE.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_AO_ALREADY_INCLUDED.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_AO_BP_NON_ACTIVE.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_AO_NOT_AVAILABLE.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_BAD_PHASE.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_BP_EXISTS.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_NO_BP.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_CREATE_NO_BUNDLE.getCode()) {
    return buildBadRequestResponse(exception, uriInfo);
  } else if (exception.getCode() == ErrorCode.SUB_GET_INVALID_BUNDLE_ID.getCode()) {
    return buildNotFoundResponse(exception, uriInfo);
origin: org.kill-bill.billing/killbill-beatrix

private List<AuditLog> getAuditLogsForSubscription(final UUID bundleId, final UUID subscriptionId, final TenantContext context) {
  try {
    final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, context);
    return auditUserApi.getAccountAuditLogs(bundle.getAccountId(), AuditLevel.FULL, context).getAuditLogsForSubscription(subscriptionId);
  } catch (final SubscriptionApiException e) {
    Assert.fail(e.toString());
    return null;
  }
}
origin: org.kill-bill.billing/killbill-entitlement

  Assert.fail("Expected getActiveSubscriptionBundleForExternalKey to fail after cancellation");
} catch (SubscriptionApiException e) {
  assertEquals(e.getCode(), ErrorCode.SUB_GET_INVALID_BUNDLE_KEY.getCode());
origin: org.kill-bill.billing/killbill-beatrix

private List<AuditLog> getAuditLogsForSubscriptionEvent(final UUID bundleId, final UUID subscriptionEventId, final TenantContext context) {
  try {
    final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, context);
    return auditUserApi.getAccountAuditLogs(bundle.getAccountId(), AuditLevel.FULL, context).getAuditLogsForSubscriptionEvent(subscriptionEventId);
  } catch (final SubscriptionApiException e) {
    Assert.fail(e.toString());
    return null;
  }
}
origin: org.kill-bill.billing/killbill-beatrix

private List<AuditLog> getAuditLogsForBundle(final UUID bundleId, final TenantContext context) {
  try {
    final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, context);
    return auditUserApi.getAccountAuditLogs(bundle.getAccountId(), AuditLevel.FULL, context).getAuditLogsForBundle(bundle.getId());
  } catch (final SubscriptionApiException e) {
    Assert.fail(e.toString());
    return null;
  }
}
origin: org.kill-bill.billing/killbill-subscription

@Override
protected SubscriptionApiException generateAlreadyExistsException(final SubscriptionBundleModelDao entity, final InternalCallContext context) {
  return new SubscriptionApiException(ErrorCode.SUB_CREATE_ACTIVE_BUNDLE_KEY_EXISTS, entity.getExternalKey());
}
org.killbill.billing.entitlement.apiSubscriptionApiException

Most used methods

  • getCode
  • <init>
  • toString

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now