use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class DefaultTestHelper method prepareProcessedItem.
@Override
public IdmProcessedTaskItemDto prepareProcessedItem(IdmScheduledTaskDto d) {
IdmProcessedTaskItemDto item = new IdmProcessedTaskItemDto();
item.setReferencedDtoType(IdmIdentityDto.class.getCanonicalName());
item.setReferencedEntityId(UUID.randomUUID());
item.setScheduledTaskQueueOwner(d.getId());
item.setOperationResult(new OperationResult.Builder(OperationState.EXECUTED).build());
return item;
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class SchedulerTestUtils method checkLogItems.
public static <E extends AbstractDto> void checkLogItems(IdmLongRunningTaskDto longRunningTask, Class<E> dtoClazz, Page<IdmProcessedTaskItemDto> logItems) {
//
for (IdmProcessedTaskItemDto qi : logItems) {
assertEquals(longRunningTask.getId(), qi.getLongRunningTask());
assertEquals(dtoClazz.getCanonicalName(), qi.getReferencedDtoType());
assertEquals(OperationState.EXECUTED, qi.getOperationResult().getState());
}
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class SchedulerTestUtils method checkQueueItems.
public static <E extends AbstractDto> void checkQueueItems(IdmScheduledTaskDto scheduledTask, Class<E> dtoClazz, Page<IdmProcessedTaskItemDto> queueItems) {
//
for (IdmProcessedTaskItemDto qi : queueItems) {
assertEquals(scheduledTask.getId(), qi.getScheduledTaskQueueOwner());
assertEquals(dtoClazz.getCanonicalName(), qi.getReferencedDtoType());
assertEquals(OperationState.EXECUTED, qi.getOperationResult().getState());
}
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class DefaultTestHelper method prepareProcessedItem.
@Override
public IdmProcessedTaskItemDto prepareProcessedItem(IdmScheduledTaskDto d, OperationState state) {
IdmProcessedTaskItemDto item = new IdmProcessedTaskItemDto();
item.setReferencedDtoType(IdmIdentityDto.class.getCanonicalName());
item.setReferencedEntityId(UUID.randomUUID());
item.setScheduledTaskQueueOwner(d.getId());
item.setOperationResult(new OperationResult.Builder(state).build());
return item;
}
use of eu.bcvsolutions.idm.core.scheduler.api.dto.IdmProcessedTaskItemDto in project CzechIdMng by bcvsolutions.
the class IdmLongRunningTaskItemController method addToQueue.
@ResponseBody
@RequestMapping(value = "/{backendId}/queue-item", method = RequestMethod.POST)
@PreAuthorize("hasAuthority('" + CoreGroupPermission.SCHEDULER_CREATE + "')")
@ApiOperation(value = "Create record", nickname = "createRecord", tags = { IdmLongRunningTaskItemController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.SCHEDULER_CREATE, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.SCHEDULER_CREATE, description = "") }) })
public ResponseEntity<?> addToQueue(@ApiParam(value = "Records's uuid identifier", required = true) @PathVariable @NotNull String backendId, @Valid @RequestBody UUID scheduledTask) {
IdmScheduledTaskDto task = scheduledTaskService.get(scheduledTask);
IdmProcessedTaskItemDto itemDto = itemService.get(backendId);
itemService.createQueueItem(itemDto, new OperationResult(OperationState.EXECUTED), task);
//
return new ResponseEntity<>(HttpStatus.CREATED);
}
Aggregations