예제 #1
0
 @Override
 public List<TagDefinition> getTagDefinitions(
     final Collection<UUID> tagDefinitionIds, final TenantContext context)
     throws TagDefinitionApiException {
   return tagDefinitionDao.getByIds(
       tagDefinitionIds, internalCallContextFactory.createInternalTenantContext(context));
 }
예제 #2
0
 @Override
 public TagDefinition create(
     final String definitionName, final String description, final CallContext context)
     throws TagDefinitionApiException {
   return tagDefinitionDao.create(
       definitionName, description, internalCallContextFactory.createInternalCallContext(context));
 }
예제 #3
0
 @Override
 public TagDefinition getTagDefinitionForName(
     final String tagDefinitionName, final TenantContext context)
     throws TagDefinitionApiException {
   return tagDefinitionDao.getByName(
       tagDefinitionName, internalCallContextFactory.createInternalTenantContext(context));
 }
예제 #4
0
 @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));
 }
예제 #5
0
 @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));
   }
 }
예제 #6
0
  @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));
  }
예제 #7
0
 @Override
 public TagDefinition getTagDefinition(final UUID tagDefinitionId, final TenantContext context)
     throws TagDefinitionApiException {
   return tagDefinitionDao.getById(
       tagDefinitionId, internalCallContextFactory.createInternalTenantContext(context));
 }
예제 #8
0
 @Override
 public void deleteTagDefinition(final UUID definitionId, final CallContext context)
     throws TagDefinitionApiException {
   tagDefinitionDao.deleteById(
       definitionId, internalCallContextFactory.createInternalCallContext(context));
 }
예제 #9
0
 @Override
 public List<TagDefinition> getTagDefinitions(final TenantContext context) {
   return tagDefinitionDao.getTagDefinitions(
       internalCallContextFactory.createInternalTenantContext(context));
 }
예제 #10
0
 @Override
 public Map<String, Tag> getTags(
     final UUID objectId, final ObjectType objectType, final TenantContext context) {
   return tagDao.loadEntities(
       objectId, objectType, internalCallContextFactory.createInternalTenantContext(context));
 }