Tabnine Logo
TagUserApi.getTagsForObject
Code IndexAdd Tabnine to your IDE (free)

How to use
getTagsForObject
method
in
com.ning.billing.util.api.TagUserApi

Best Java code snippets using com.ning.billing.util.api.TagUserApi.getTagsForObject (Showing top 2 results out of 315)

origin: com.ning.billing/killbill-jaxrs

protected Response getTags(final UUID accountId, final UUID taggedObjectId, final AuditMode auditMode, final boolean includeDeleted, final TenantContext context) throws TagDefinitionApiException {
  final List<Tag> tags = tagUserApi.getTagsForObject(taggedObjectId, getObjectType(), includeDeleted, context);
  final AccountAuditLogsForObjectType tagsAuditLogs = auditUserApi.getAccountAuditLogs(accountId, ObjectType.TAG, auditMode.getLevel(), context);
  final Map<UUID, TagDefinition> tagDefinitionsCache = new HashMap<UUID, TagDefinition>();
  final Collection<TagJson> result = new LinkedList<TagJson>();
  for (final Tag tag : tags) {
    if (tagDefinitionsCache.get(tag.getTagDefinitionId()) == null) {
      tagDefinitionsCache.put(tag.getTagDefinitionId(), tagUserApi.getTagDefinition(tag.getTagDefinitionId(), context));
    }
    final TagDefinition tagDefinition = tagDefinitionsCache.get(tag.getTagDefinitionId());
    final List<AuditLog> auditLogs = tagsAuditLogs.getAuditLogs(tag.getId());
    result.add(new TagJson(tag, tagDefinition, auditLogs));
  }
  return Response.status(Response.Status.OK).entity(result).build();
}
origin: com.ning.billing/killbill-invoice

  @Test(groups = "slow")
  public void testAddRemoveWrittenOffTag() throws InvoiceApiException, TagApiException {
    invoiceUserApi.tagInvoiceAsWrittenOff(invoiceId, callContext);

    List<Tag> tags = tagUserApi.getTagsForObject(invoiceId, ObjectType.INVOICE, false, callContext);
    assertEquals(tags.size(), 1);
    assertEquals(tags.get(0).getTagDefinitionId(), ControlTagType.WRITTEN_OFF.getId());

    invoiceUserApi.tagInvoiceAsNotWrittenOff(invoiceId, callContext);
    tags = tagUserApi.getTagsForObject(invoiceId, ObjectType.INVOICE, false, callContext);
    assertEquals(tags.size(), 0);
  }
}
com.ning.billing.util.apiTagUserApigetTagsForObject

Popular methods of TagUserApi

  • addTags
  • createTagDefinition
  • deleteTagDefinition
  • getTagDefinition
  • getTagDefinitions
  • getTags
  • removeTags
  • searchTags
    Find all tags having their object type, associated tag definition name or description matching the s

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Permission (java.security)
    Legacy security code; do not use.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ImageIO (javax.imageio)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 12 Jupyter Notebook extensions
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