congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TagApiException.getCode
Code IndexAdd Tabnine to your IDE (free)

How to use
getCode
method
in
com.ning.billing.util.api.TagApiException

Best Java code snippets using com.ning.billing.util.api.TagApiException.getCode (Showing top 4 results out of 315)

origin: com.ning.billing/killbill-jaxrs

  @Override
  public Response toResponse(final TagApiException exception) {
    if (exception.getCode() == ErrorCode.TAG_DOES_NOT_EXIST.getCode()) {
      return buildNotFoundResponse(exception, uriInfo);
    } else if (exception.getCode() == ErrorCode.TAG_CANNOT_BE_REMOVED.getCode()) {
      return buildBadRequestResponse(exception, uriInfo);
    } else {
      return buildBadRequestResponse(exception, uriInfo);
    }
  }
}
origin: com.ning.billing/killbill-overdue

private void remove_AUTO_INVOICE_OFF_on_clear(final UUID accountId, final InternalCallContext context) throws OverdueApiException {
  try {
    tagApi.removeTag(accountId, ObjectType.ACCOUNT, ControlTagType.AUTO_INVOICING_OFF.getId(), context);
  } catch (TagApiException e) {
    if (e.getCode() != ErrorCode.TAG_DOES_NOT_EXIST.getCode()) {
      throw new OverdueApiException(e);
    }
  }
}
origin: com.ning.billing/killbill-util

@Override
public void addTag(final UUID objectId, final ObjectType objectType, final UUID tagDefinitionId, final CallContext context) throws TagApiException {
  final InternalCallContext internalContext = internalCallContextFactory.createInternalCallContext(objectId, objectType, context);
  final TagModelDao tag = new TagModelDao(context.getCreatedDate(), tagDefinitionId, objectId, objectType);
  try {
    tagDao.create(tag, internalContext);
  } catch (TagApiException e) {
    // Be lenient here and make the addTag method idempotent
    if (ErrorCode.TAG_ALREADY_EXISTS.getCode() != e.getCode()) {
      throw e;
    }
  }
}
origin: com.ning.billing/killbill-util

@Test(groups = "slow")
public void testInsertMultipleTags() throws TagApiException {
  final UUID objectId = UUID.randomUUID();
  final ObjectType objectType = ObjectType.INVOICE_ITEM;
  eventsListener.pushExpectedEvent(NextEvent.TAG);
  final Tag tag = new DescriptiveTag(ControlTagType.AUTO_INVOICING_OFF.getId(), objectType, objectId, internalCallContext.getCreatedDate());
  tagDao.create(new TagModelDao(tag), internalCallContext);
  assertListenerStatus();
  try {
    final Tag tag2 = new DescriptiveTag(ControlTagType.AUTO_INVOICING_OFF.getId(), objectType, objectId, internalCallContext.getCreatedDate());
    tagDao.create(new TagModelDao(tag2), internalCallContext);
    Assert.fail("Should not be able to create twice the same tag");
    assertListenerStatus();
  } catch (final TagApiException e) {
    Assert.assertEquals(ErrorCode.TAG_ALREADY_EXISTS.getCode(), e.getCode());
  }
}
com.ning.billing.util.apiTagApiExceptiongetCode

Popular methods of TagApiException

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Top Vim 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