/** * {@inheritDoc} */ @Override public void setExecutionResolver(final ResolverService resolver) { checkNotNull(resolver,"Execution resolver cannot be null"); this.es.withResolverService(resolver); }
private void processEnrichmentResult(final EnrichmentContext context, final EnrichmentRequest request, final EnrichmentResult result) { LOGGER.debug("Processing enrichment result {} about {} ({})",result,request,context); final ExecutionEnrichment enrichment=UseCase.processResult(context,result); try { EnrichmentRequestor.this.service.addEnrichment(context,enrichment); } catch (final IOException e) { LOGGER.warn("Processing of enrichment result {} about {} ({}) failed. Full stacktrace follows",result,request,context,e); } }
private Set<URI> enrichedExecutions() { final Set<URI> executions=Sets.newLinkedHashSet(); for(final CompletedEnrichment pe:completedEnrichments()) { executions.addAll(pe.executions()); } return executions; }
private void doRequestEnrichment(final Execution execution) { LOGGER.debug("Requested enrichment for {}",execution); final EnrichmentContext context = createContext(execution); if(context.requiresEnrichment()) { processPendingEnrichment(context); } else { processCompletedEnrichment(context,ImmutableSet.of(execution.executionId())); } }
final EnrichmentContext freshContext=createContext(execution); if(!freshContext.requiresEnrichment()) { LOGGER.info("Discarding enrichment {}: execution {} is already enriched",enrichment,execution); if(freshContext.requiresRepository() && !freshContext.enrichment().repositoryResource().isPresent()) { if(enrichment.repositoryResource().isPresent()) { createRepository(freshContext, enrichment, repositoryLocation); } else { LOGGER.error("Enrichment does not have the expected resource for repository {}",repositoryLocation); if(freshContext.requiresBranch() && !freshContext.enrichment().branchResource().isPresent()) { if(enrichment.branchResource().isPresent()) { createBranch(freshContext, enrichment, repositoryLocation,branchName); } else { LOGGER.error("Enrichment does not have the expected resource for branch {{}}{}",repositoryLocation,branchName); if(freshContext.requiresCommit() && !freshContext.enrichment().commitResource().isPresent()) { if(enrichment.commitResource().isPresent()) { createCommit(freshContext, enrichment, repositoryLocation, branchName, commitId); } else { LOGGER.error("Enrichment does not have the expected resource for commit {{{}}{}}{}",repositoryLocation,branchName,commitId); finalizePendingEnrichment(pendingEnrichment); processCompletedEnrichment(freshContext,pendingEnrichment.executions());
final OperationStrategy operationStrategy, final ResolverService resolver) throws IOException { this.erService.withResolverService(resolver).connect(); try { LOGGER.info("Connecting to {}...",jenkinsInstance);
private BackendFacade(final ComponentRegistry componentRegistry, final Deployment configuration) { this.componentRegistry=componentRegistry; this.scmService = new SourceCodeManagementService( this.componentRegistry.getRepositoryRepository(), this.componentRegistry.getBranchRepository(), this.componentRegistry.getCommitRepository()); this.enrichmentService= new EnrichmentService( this.scmService, this.componentRegistry.getExecutionRepository(), this.componentRegistry.getPendingEnrichmentRepository(), this.componentRegistry.getCompletedEnrichmentRepository(), this.componentRegistry.getTransactionManager(), configuration); this.applicationService= new ContinuousIntegrationService( this.componentRegistry.getServiceRepository(), this.componentRegistry.getBuildRepository(), this.componentRegistry.getExecutionRepository()); this.integrationService= new JenkinsIntegrationService( this.applicationService, this.enrichmentService, this.componentRegistry.getTransactionManager()); }
public JenkinsIntegrationService deregisterListener(final EntityLifecycleEventListener listener) { this.erService.deregisterListener(listener); this.listeners.deregisterListener(listener); return this; }
public ExecutionEnrichment getEnrichment(final Execution execution) { this.read.lock(); try { return createContext(execution).enrichment(); } finally { this.read.unlock(); } }
TestingBackendController(final Deployment deployment) { this.serviceRepository = new InMemoryServiceRepository(); this.buildRepository = new InMemoryBuildRepository(); this.executionRepository = new InMemoryExecutionRepository(); this.service= new ContinuousIntegrationService( this.serviceRepository, this.buildRepository, this.executionRepository); this.scmService = new SourceCodeManagementService( new InMemoryRepositoryRepository(), new InMemoryBranchRepository(), new InMemoryCommitRepository()); this.es = new EnrichmentService( this.scmService, this.executionRepository, new InMemoryPendingEnrichmentRepository(), new InMemoryCompletedEnrichmentRepository(), new InMemoryTransactionManager(), deployment); this.index=new TestingEntityIndex(this.service,this.es); }