Search in sources :

Example 1 with SoftDeletableObject

use of org.hisp.dhis.common.SoftDeletableObject in project dhis2-core by dhis2.

the class JdbcMaintenanceStore method auditHardDeletedEntity.

private void auditHardDeletedEntity(List<String> deletedEntities, Class<? extends SoftDeletableObject> entity) {
    deletedEntities.forEach(deletedEntity -> {
        SoftDeletableObject object = ENTITY_MAPPER.getOrDefault(entity, new SoftDeletableObject());
        object.setUid(deletedEntity);
        object.setDeleted(true);
        auditManager.send(Audit.builder().auditType(AuditType.DELETE).auditScope(AuditScope.TRACKER).createdAt(LocalDateTime.now()).object(object).uid(deletedEntity).auditableEntity(new AuditableEntity(entity, object)).build());
    });
}
Also used : AuditableEntity(org.hisp.dhis.artemis.audit.AuditableEntity) SoftDeletableObject(org.hisp.dhis.common.SoftDeletableObject)

Aggregations

AuditableEntity (org.hisp.dhis.artemis.audit.AuditableEntity)1 SoftDeletableObject (org.hisp.dhis.common.SoftDeletableObject)1