@SuppressWarnings("fallthrough") private static void validateCSVRequest(ExportCSVDataRequestMsg request) { if (request.getExportType() == null) { throw new IllegalArgumentException("specify an export type"); } switch (request.getExportType()) { case AUDIT_LOGS: break; case AVAILABILITY: if (request.isAllServices() == null && request.getURLs().isEmpty()) { throw new IllegalArgumentException("either all services needs to be set, or specify a list of urls from which to export data."); } break; case STATISTICS: if (request.isAllServices() == null && request.getURLs().isEmpty()) { throw new IllegalArgumentException("either all services needs to be set, or specify a list of urls from which to export data."); } break; case TRANSACTIONS: if (request.isAllServices() == null && request.getURLs().isEmpty()) { throw new IllegalArgumentException("either all services needs to be set, or specify a list of urls from which to export data."); } case MACHINE: case PROCESS: if (request.isAllServices() == null && request.getURLs().isEmpty()) { throw new IllegalArgumentException("either all services needs to be set, or specify a list of urls from which to export data."); } break; } }
throw new IllegalArgumentException("time range"); if (request.getExportType() == null) { throw new IllegalArgumentException("a records type must be specified");
throw new IllegalArgumentException("request"); if (request.getExportType() == null) { throw new IllegalArgumentException("report type"); if (request.getExportType().value().equalsIgnoreCase(ExportRecordsEnum.AUDIT_LOGS.value())) { UserIdentityUtil.assertGlobalAuditRole(currentuser, "GenerateCSVReport", request.getClassification(), ctx); generateAuditCSVReport(request, filenameandpath, filelist, currentuser, security); return; if (request.getExportType().value().equalsIgnoreCase(ExportRecordsEnum.ALL.value()) && UserIdentityUtil.hasGlobalAuditRole(currentuser, "GenerateCSVReport", security, ctx)) { generateAuditCSVReport(request, filenameandpath, filelist, currentuser, security); switch (request.getExportType()) { case ALL: generateAvailabilityCSVReport(request, filenameandpath, filelist, currentuser, urlstoprocess.get(i), security);