Search in sources :

Example 1 with SysProvisioningArchiveService

use of eu.bcvsolutions.idm.acc.service.api.SysProvisioningArchiveService in project CzechIdMng by bcvsolutions.

the class SysProvisioningArchiveController method getDifferenceObject.

@ResponseBody
@RequestMapping(value = "/{backendId}/difference-object", method = RequestMethod.GET)
@PreAuthorize("hasAuthority('" + AccGroupPermission.PROVISIONING_ARCHIVE_READ + "')")
@ApiOperation(value = "Detail of the provisioning changes", nickname = "getProvisioningDetail", tags = { SysProvisioningArchiveController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = AccGroupPermission.PROVISIONING_ARCHIVE_READ, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = AccGroupPermission.PROVISIONING_ARCHIVE_READ, description = "") }) })
public ResponseEntity<?> getDifferenceObject(@ApiParam(value = "Provisioning detail uuid identifier.", required = true) @PathVariable @NotNull String backendId) {
    SysProvisioningArchiveDto archive = getDto(backendId);
    if (archive == null) {
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }
    ProvisioningContext context = archive.getProvisioningContext();
    if (context == null) {
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }
    List<SysAttributeDifferenceDto> result = ((SysProvisioningArchiveService) getService()).evaluateProvisioningDifferences(context.getSystemConnectorObject(), context.getConnectorObject());
    return new ResponseEntity<>(result, HttpStatus.OK);
}
Also used : ProvisioningContext(eu.bcvsolutions.idm.acc.domain.ProvisioningContext) ResponseEntity(org.springframework.http.ResponseEntity) SysProvisioningArchiveDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto) SysProvisioningArchiveService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningArchiveService) SysAttributeDifferenceDto(eu.bcvsolutions.idm.acc.dto.SysAttributeDifferenceDto) ApiOperation(io.swagger.annotations.ApiOperation) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ProvisioningContext (eu.bcvsolutions.idm.acc.domain.ProvisioningContext)1 SysAttributeDifferenceDto (eu.bcvsolutions.idm.acc.dto.SysAttributeDifferenceDto)1 SysProvisioningArchiveDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto)1 SysProvisioningArchiveService (eu.bcvsolutions.idm.acc.service.api.SysProvisioningArchiveService)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ResponseEntity (org.springframework.http.ResponseEntity)1 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1