public static final boolean existsInBackend(Application _app) { boolean exists = false; try { exists = BackendConnector.getInstance().isAppExisting(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), _app); } catch (BackendConnectionException e) { log.error("Error while checking whether " + _app + " exists in backend: " + e.getMessage()); } return exists; }
public StackTraceInstrumentor() { try { final Map<String, Set<com.sap.psr.vulas.shared.json.model.ConstructId>> bug_change_lists = BackendConnector.getInstance().getAppBugs(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext()); this.constructsCollectStacktrace = AbstractTraceInstrumentor.merge(bug_change_lists); } catch (ConfigurationException e) { StackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } catch (IllegalStateException e) { StackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } catch (BackendConnectionException e) { StackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } }
public SingleStackTraceInstrumentor() { this.maxStacktraces = VulasConfiguration.getGlobal().getConfiguration().getInt(CoreConfiguration.INSTR_MAX_STACKTRACES, 10); try { final Map<String, Set<com.sap.psr.vulas.shared.json.model.ConstructId>> bug_change_lists = BackendConnector.getInstance().getAppBugs(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext()); this.constructsCollectStacktrace = AbstractTraceInstrumentor.merge(bug_change_lists); } catch (ConfigurationException e) { SingleStackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } catch (IllegalStateException e) { SingleStackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } catch (BackendConnectionException e) { SingleStackTraceInstrumentor.log.error("Error during instantiation: " + e.getMessage()); throw new IllegalStateException("Error during instantiation: " + e.getMessage(), e); } }
/** * Uploads trace information collected during JVM execution to the central collector. * If batch size is equal to -1, all traces will be uploaded. */ private synchronized void uploadTraces(int _batch_size) { if(this.constructUsage.isEmpty()) TraceCollector.getLog().info("No traces collected"); else { try { BackendConnector.getInstance().uploadTraces(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext(), this.toJSON(_batch_size)); } catch (Exception e) { this.getLog().error("Error while uploaded traces: " + e.getMessage()); } } }
private ConstructIdUtil() { try { final Set<com.sap.psr.vulas.shared.json.model.ConstructId> app_constructs = BackendConnector.getInstance().getAppConstructIds(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext()); this.appConstructs = new HashSet<ConstructId>(); for(com.sap.psr.vulas.shared.json.model.ConstructId cid: app_constructs) { this.appConstructs.add(JavaId.toCoreType(cid)); } } catch (ConfigurationException e) { ConstructIdUtil.getLog().error(e.getMessage(), e); } catch (BackendConnectionException e) { ConstructIdUtil.getLog().error(e.getMessage(), e); } }
BackendConnector.getInstance().uploadTouchPoints(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext(), entry.getKey(), myArray.toString()); } catch (ConfigurationException e) { TouchPointCollector.getLog().error(e.getMessage(), e);
Map<String, Set<com.sap.psr.vulas.shared.json.model.ConstructId>> change_lists = null; try { change_lists = BackendConnector.getInstance().getAppBugs(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), app_ctx); } catch (BackendConnectionException e) { TraceCollector.getLog().error("Error while reading app bugs: " + e.getMessage(), e); BackendConnector.getInstance().uploadPaths(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), app_ctx, json.toString()); } catch (BackendConnectionException e) { TraceCollector.getLog().error("Error while uploading paths: " + e.getMessage(), e);
try { final Set<Dependency> deps = BackendConnector.getInstance().getAppDeps(CoreConfiguration.buildGoalContextFromGlobalConfiguration(), CoreConfiguration.getAppContext()); int blacklisted_deps_count = 0; for(Dependency dep: deps) {