public static PeriodStringParser getParser() { if (instance == null) { instance = new PeriodStringParser(); } return instance; }
public Build getBuggyBuild() { return this.buildToBeInspected.getBuggyBuild(); }
public Build getPatchedBuild() { return this.buildToBeInspected.getPatchedBuild(); }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.CHECKBRANCHES.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private List<Object> serializeAsList(BuildToBeInspected buildToBeInspected, RepairPatch patch) { Build build = buildToBeInspected.getBuggyBuild(); List<Object> result = new ArrayList<>(); result.add(Utils.formatCompleteDate(new Date())); result.add(buildToBeInspected.getRunId()); result.add(build.getId()); result.add(patch.getToolname()); result.add(patch.getDiff()); result.add(patch.getFilePath()); result.add(Utils.getHostname()); return result; }
private void initSerializerEngines() { this.engines = new ArrayList<>(); List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER); this.engines.addAll(fileSerializerEngines); SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER); if (mongoDBSerializerEngine != null) { this.engines.add(mongoDBSerializerEngine); } }
public void notifyEnd() { String subject = "Process "+processName+" on "+Utils.getHostname()+" finished"; Date endDate = new Date(); String message = "The following process: "+ processName +" launched on "+ Utils.getHostname()+ " the "+ this.launchDate.toString()+" and finished "+endDate.toString()+". " + "It ran for a total time of "+Utils.getDuration(this.launchDate, endDate); for (NotifierEngine engine : this.engines) { engine.notify(subject, message); } } }
private RTLauncher(String[] args) throws JSAPException { JSAP jsap = this.defineArgs(); JSAPResult arguments = jsap.parse(args); LauncherUtils.checkArguments(jsap, arguments, LauncherType.REALTIME); this.initConfig(arguments); this.initSerializerEngines(); this.initNotifiers(); this.initSummaryEmails(); }
private JsonElement serializeAsJson(ProjectInspector inspector, String toolName, JsonElement jsonElement) { BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected(); JsonObject data = new JsonObject(); data.addProperty("dateStr", Utils.formatCompleteDate(new Date())); this.addDate(data, "date", new Date()); data.addProperty("runId", buildToBeInspected.getRunId()); data.addProperty("buildId", buildToBeInspected.getBuggyBuild().getId()); data.addProperty("toolname", toolName); data.add("diagnostic", jsonElement); return data; }
private Launcher(String[] args) throws JSAPException { JSAP jsap = this.defineArgs(); JSAPResult arguments = jsap.parse(args); LauncherUtils.checkArguments(jsap, arguments, LauncherType.DOCKERPOOL); this.initConfig(arguments); this.initSerializerEngines(); this.initNotifiers(); }
private Launcher(String[] args) throws JSAPException { JSAP jsap = this.defineArgs(); JSAPResult arguments = jsap.parse(args); LauncherUtils.checkArguments(jsap, arguments, LauncherType.CHECKBRANCHES); this.initConfig(arguments); this.initNotifiers(); }
public static void checkPushUrlArg(JSAP jsap, JSAPResult arguments, LauncherType launcherType) { if (getArgPushUrl(arguments) != null) { if (!Utils.matchesGithubRepoUrl(getArgPushUrl(arguments))) { System.err.println("The value of the argument pushurl is wrong."); LauncherUtils.printUsage(jsap, launcherType); } } }
private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); result.addProperty("runId", this.runId); result.addProperty("buildId", this.buildId); result.addProperty("hostname", Utils.getHostname()); result.addProperty("nbProcessors", Runtime.getRuntime().availableProcessors()); result.addProperty("freeMemory", Runtime.getRuntime().freeMemory()); result.addProperty("totalMemory", Runtime.getRuntime().totalMemory()); return result; }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.SCANNER.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private JsonElement serializeAsJson(BuildToBeInspected buildToBeInspected, RepairPatch patch) { Build build = buildToBeInspected.getBuggyBuild(); JsonObject data = new JsonObject(); data.addProperty("dateStr", Utils.formatCompleteDate(new Date())); this.addDate(data, "date", new Date()); data.addProperty("runId", buildToBeInspected.getRunId()); data.addProperty("buildId", build.getId()); data.addProperty("toolname", patch.getToolname()); data.addProperty("diff", patch.getDiff()); data.addProperty("filepath", patch.getFilePath()); data.addProperty("hostname", Utils.getHostname()); return data; }
private void initSerializerEngines() { this.engines = new ArrayList<>(); List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER); this.engines.addAll(fileSerializerEngines); SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER); if (mongoDBSerializerEngine != null) { this.engines.add(mongoDBSerializerEngine); } }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.DOCKERPOOL.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void initSerializerEngines() { this.engines = new ArrayList<>(); List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER); this.engines.addAll(fileSerializerEngines); SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER); if (mongoDBSerializerEngine != null) { this.engines.add(mongoDBSerializerEngine); } }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.REALTIME.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void initSerializerEngines() { this.engines = new ArrayList<>(); List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER); this.engines.addAll(fileSerializerEngines); SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER); if (mongoDBSerializerEngine != null) { this.engines.add(mongoDBSerializerEngine); } }