use of com.synopsys.integration.alert.common.rest.model.AuditJobStatusesModel in project hub-alert by blackducksoftware.
the class AuditEntryActions method queryForAuditInfoInJobs.
public ActionResponse<AuditJobStatusesModel> queryForAuditInfoInJobs(JobIdsRequestModel queryRequestModel) {
if (!authorizationManager.hasReadPermission(ConfigContextEnum.GLOBAL, descriptorKey)) {
return new ActionResponse<>(HttpStatus.FORBIDDEN, ActionResponse.FORBIDDEN_MESSAGE);
}
List<UUID> jobIds = queryRequestModel.getJobIds();
for (UUID jobId : jobIds) {
if (null == jobId) {
return new ActionResponse<>(HttpStatus.BAD_REQUEST, "The field 'jobIds' cannot contain null values");
}
}
List<AuditJobStatusModel> auditJobStatusModels = auditAccessor.findByJobIds(jobIds);
return new ActionResponse<>(HttpStatus.OK, new AuditJobStatusesModel(auditJobStatusModels));
}
Aggregations