private void rebuildConnectionPluginsInSoftwareAccess(Wall wall) { for (SoftwareAccess softwareAccess : wall.getSoftwareAccesses()) { try { VisuwallPlugin<BasicCapability> plugin = pluginService.getPluginFromUrl(softwareAccess.getUrl()); BasicCapability connection = plugin.getConnection(softwareAccess.getUrl().toString(), null); softwareAccess.setConnection(connection); } catch (ConnectionException e) { LOG.warn("Can't rebuild connection. " + softwareAccess, e); } } }
private Runnable getDiscoverBuildProjectsRunner( final Wall wall, final SoftwareAccess softwareAccess) { if (!(softwareAccess.getConnection() instanceof BuildCapability)) { throw new RuntimeException("Software should be a build one " + softwareAccess); } return new Runnable() { @Override public void run() { LOG.debug("Running Project Discover task for " + softwareAccess + " in wall " + wall); Set<SoftwareProjectId> projectIds = softwareAccessService.discoverBuildProjects(softwareAccess); List<SoftwareProjectId> wallBuildProjectIds = wall.getProjects().getBuildProjectIds(); for (SoftwareProjectId projectId : projectIds) { if (wallBuildProjectIds.contains(projectId)) { // this project is already registered in list continue; } Runnable projectCreationRunner = WallProcess.this.projectService.getProjectCreationRunner( wall, softwareAccess, projectId); projectCreationRunner.run(); // taskScheduler.schedule(projectCreationRunner, new Date()); } } }; }
private Runnable getDiscoverOtherProjectsRunner( final Wall wall, final SoftwareAccess softwareAccess) { if (softwareAccess.getConnection() instanceof BuildCapability) { throw new RuntimeException("Software should not be a build one " + softwareAccess); } return new Runnable() { @Override public void run() { for (Project project : wall.getProjects()) { try { SoftwareProjectId softwareProjectId = softwareAccess.getConnection().identify(project.getProjectKey()); project.getCapabilities().put(softwareProjectId, softwareAccess.getConnection()); } catch (ProjectNotFoundException e) { LOG.debug( "ProjectKey {} not found in software {}", project.getProjectKey(), softwareAccess); } } } }; }