@Override public List<TagDefinition> getTagDefinitions( final Collection<UUID> tagDefinitionIds, final TenantContext context) throws TagDefinitionApiException { return tagDefinitionDao.getByIds( tagDefinitionIds, internalCallContextFactory.createInternalTenantContext(context)); }
@Override public TagDefinition create( final String definitionName, final String description, final CallContext context) throws TagDefinitionApiException { return tagDefinitionDao.create( definitionName, description, internalCallContextFactory.createInternalCallContext(context)); }
@Override public TagDefinition getTagDefinitionForName( final String tagDefinitionName, final TenantContext context) throws TagDefinitionApiException { return tagDefinitionDao.getByName( tagDefinitionName, internalCallContextFactory.createInternalTenantContext(context)); }
@Override public void removeTag( final UUID objectId, final ObjectType objectType, final UUID tagDefinitionId, final CallContext context) throws TagApiException { tagDao.deleteTag( objectId, objectType, tagDefinitionId, internalCallContextFactory.createInternalCallContext(objectId, objectType, context)); }
@Override public void addTags( final UUID objectId, final ObjectType objectType, final Collection<UUID> tagDefinitionIds, final CallContext context) throws TagApiException { // TODO: consider making this batch for (final UUID tagDefinitionId : tagDefinitionIds) { tagDao.insertTag( objectId, objectType, tagDefinitionId, internalCallContextFactory.createInternalCallContext(objectId, objectType, context)); } }
@Override public List<AuditLog> getAuditLogs( final UUID objectId, final ObjectType objectType, final AuditLevel auditLevel, final TenantContext context) { // Optimization - bail early if (AuditLevel.NONE.equals(auditLevel)) { return ImmutableList.<AuditLog>of(); } final TableName tableName = getTableNameFromObjectType(objectType); if (tableName == null) { return ImmutableList.<AuditLog>of(); } return auditDao.getAuditLogsForId( tableName, objectId, auditLevel, internalCallContextFactory.createInternalTenantContext(context)); }
@Override public TagDefinition getTagDefinition(final UUID tagDefinitionId, final TenantContext context) throws TagDefinitionApiException { return tagDefinitionDao.getById( tagDefinitionId, internalCallContextFactory.createInternalTenantContext(context)); }
@Override public void deleteTagDefinition(final UUID definitionId, final CallContext context) throws TagDefinitionApiException { tagDefinitionDao.deleteById( definitionId, internalCallContextFactory.createInternalCallContext(context)); }
@Override public List<TagDefinition> getTagDefinitions(final TenantContext context) { return tagDefinitionDao.getTagDefinitions( internalCallContextFactory.createInternalTenantContext(context)); }
@Override public Map<String, Tag> getTags( final UUID objectId, final ObjectType objectType, final TenantContext context) { return tagDao.loadEntities( objectId, objectType, internalCallContextFactory.createInternalTenantContext(context)); }