Search in sources :

Example 1 with Builder

use of eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto.Builder in project CzechIdMng by bcvsolutions.

the class DefaultSysProvisioningArchiveService method archive.

@Override
// we want log in archive always
@Transactional(propagation = Propagation.REQUIRES_NEW)
public SysProvisioningArchiveDto archive(SysProvisioningOperationDto provisioningOperation) {
    Builder builder = new SysProvisioningArchiveDto.Builder(provisioningOperation);
    if (provisioningOperation.getSystemEntity() != null) {
        SysSystemEntityDto systemEntity = systemEntityService.get(provisioningOperation.getSystemEntity());
        builder.setSystemEntityUid(systemEntity.getUid());
    }
    SysProvisioningArchiveDto archive = builder.build();
    // preserve original operation creator
    archive.setCreator(provisioningOperation.getCreator());
    archive.setCreatorId(provisioningOperation.getCreatorId());
    archive.setOriginalCreator(provisioningOperation.getOriginalCreator());
    archive.setOriginalCreatorId(provisioningOperation.getOriginalCreatorId());
    return save(archive);
}
Also used : Builder(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto.Builder) SysProvisioningArchiveDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SysProvisioningArchiveDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto)1 Builder (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto.Builder)1 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)1 Transactional (org.springframework.transaction.annotation.Transactional)1