/** * Create an instance of {@link ExportCSVDataRequestMsg } * */ public ExportCSVDataRequestMsg createExportCSVDataRequestMsg() { return new ExportCSVDataRequestMsg(); }
@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; } }
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
Reporting r = new Reporting(); if (get.getExportCSVDataRequestMsg() != null) { org.miloss.fgsms.services.interfaces.reportingservice.ExportCSVDataRequestMsg x = new org.miloss.fgsms.services.interfaces.reportingservice.ExportCSVDataRequestMsg(); x.setClassification(get.getExportCSVDataRequestMsg().getClassification()); x.setAllServices(false); x.setExportType(get.getExportCSVDataRequestMsg().getExportType()); x.getURLs().addAll(get.getExportCSVDataRequestMsg().getURLs()); x.setRange(convertDiffRangeToRange(get.getExportCSVDataRequestMsg().getRange()));
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); List<String> urlstoprocess = urlListAudit(request.isAllServices(), request.getURLs(), currentuser, request.getClassification(), ctx); switch (request.getExportType()) { case ALL: generateAvailabilityCSVReport(request, filenameandpath, filelist, currentuser, urlstoprocess.get(i), security);
throw new IllegalArgumentException("request is null"); Utility.validateClassification(request.getClassification()); if (request.getRange() == null) { throw new IllegalArgumentException("time range"); if (request.getExportType() == null) { throw new IllegalArgumentException("a records type must be specified"); UserIdentityUtil.assertGlobalAdministratorRole(currentUser, "exportDataToCSV", request.getClassification(), ctx);
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
new Date().toString()); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.getTime().toString()); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.getTime().toString()); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setLong(1, request.getRange().getStart().getTimeInMillis()); com.setLong(2, request.getRange().getEnd().getTimeInMillis());
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where host=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());
+ time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getStart(); t = t.replaceAll("%DATETIME_FROM%", time.get(Calendar.YEAR) + "/" + time.get(Calendar.SECOND) + " " + ampm[time.get(Calendar.AM_PM)]); time = request.getRange().getEnd(); t = t.replaceAll("%DATETIME_TO%", time.get(Calendar.YEAR) + "/" + ampm[time.get(Calendar.AM_PM)]); if (request.getClassification() == null) { request.setClassification(security); t = t.replaceAll("%CLASSIFICATION%", (Utility.ICMClassificationToString(request.getClassification().getClassification()) + " Caveat: " + request.getClassification().getCaveats())); + "where uri=? and utcdatetime > ? and utcdatetime < ? order by utcdatetime desc ;"); com.setString(1, url); com.setLong(2, request.getRange().getStart().getTimeInMillis()); com.setLong(3, request.getRange().getEnd().getTimeInMillis());