congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TagDefinitionApiException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.ning.billing.util.api.TagDefinitionApiException
constructor

Best Java code snippets using com.ning.billing.util.api.TagDefinitionApiException.<init> (Showing top 4 results out of 315)

origin: com.ning.billing/killbill-util

  @Override
  protected TagDefinitionApiException generateAlreadyExistsException(final TagDefinitionModelDao entity, final InternalCallContext context) {
    return new TagDefinitionApiException(ErrorCode.TAG_DEFINITION_ALREADY_EXISTS, entity.getId());
  }
}
origin: com.ning.billing/killbill-util

  @Override
  public Void inTransaction(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory) throws Exception {
    final TagDefinitionSqlDao tagDefinitionSqlDao = entitySqlDaoWrapperFactory.become(TagDefinitionSqlDao.class);
    // Make sure the tag definition exists
    final TagDefinitionModelDao tagDefinition = tagDefinitionSqlDao.getById(definitionId.toString(), context);
    if (tagDefinition == null) {
      throw new TagDefinitionApiException(ErrorCode.TAG_DEFINITION_DOES_NOT_EXIST, definitionId);
    }
    // Make sure it is not used currently
    if (tagDefinitionSqlDao.tagDefinitionUsageCount(definitionId.toString(), context) > 0) {
      throw new TagDefinitionApiException(ErrorCode.TAG_DEFINITION_IN_USE, definitionId);
    }
    // Delete it
    tagDefinitionSqlDao.markTagDefinitionAsDeleted(definitionId.toString(), context);
    postBusEventFromTransaction(tagDefinition, tagDefinition, ChangeType.DELETE, entitySqlDaoWrapperFactory, context);
    return null;
  }
});
origin: com.ning.billing/killbill-util

throw new TagDefinitionApiException(ErrorCode.TAG_DEFINITION_CONFLICTS_WITH_CONTROL_TAG, definitionName);
origin: com.ning.billing/killbill-util

  @Override
  public TagDefinitionModelDao inTransaction(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory) throws Exception {
    final TagDefinitionSqlDao tagDefinitionSqlDao = entitySqlDaoWrapperFactory.become(TagDefinitionSqlDao.class);
    // Make sure the tag definition doesn't exist already
    final TagDefinitionModelDao existingDefinition = tagDefinitionSqlDao.getByName(definitionName, context);
    if (existingDefinition != null) {
      throw new TagDefinitionApiException(ErrorCode.TAG_DEFINITION_ALREADY_EXISTS, definitionName);
    }
    // Create it
    final TagDefinitionModelDao tagDefinition = new TagDefinitionModelDao(context.getCreatedDate(), definitionName, description);
    tagDefinitionSqlDao.create(tagDefinition, context);
    // Post an event to the bus
    final boolean isControlTag = TagModelDaoHelper.isControlTag(tagDefinition.getName());
    final TagDefinitionInternalEvent tagDefinitionEvent;
    if (isControlTag) {
      tagDefinitionEvent = tagEventBuilder.newControlTagDefinitionCreationEvent(tagDefinition.getId(), tagDefinition,
                                           context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
    } else {
      tagDefinitionEvent = tagEventBuilder.newUserTagDefinitionCreationEvent(tagDefinition.getId(), tagDefinition,
                                          context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
    }
    try {
      bus.postFromTransaction(tagDefinitionEvent, entitySqlDaoWrapperFactory.getSqlDao());
    } catch (PersistentBus.EventBusException e) {
      log.warn("Failed to post tag definition creation event for tag " + tagDefinition.getId(), e);
    }
    return tagDefinition;
  }
});
com.ning.billing.util.apiTagDefinitionApiException<init>

Popular methods of TagDefinitionApiException

  • getCode

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Kernel (java.awt.image)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JOptionPane (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top PhpStorm 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