static ExecutionEnrichment processResult(final EnrichmentContext context, final EnrichmentResult result) { final Bindings additions = result.additions(); return new ImmutableExecutionEnrichment(). withRepositoryResource(resolveResource(additions, ci("forRepository"))). withBranchResource(resolveResource(additions, ci("forBranch"))). withCommitResource(resolveResource(additions, ci("forCommit"))); }
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); } }
Filters. newInstance(). withFilter(ci("forRepository"), REPOSITORY). withFilter(ci("forBranch"), BRANCH). withFilter(ci("forCommit"), COMMIT)). withConstraints( forVariable(REPOSITORY). withProperty(RDF.TYPE). andResource(scm("Repository")). withProperty(scm("location")). andTypedLiteral(context.repositoryLocation(),XSD.ANY_URI_TYPE). withProperty(scm("hasBranch")). andVariable(BRANCH). forVariable(BRANCH). withProperty(RDF.TYPE). andResource(scm("Branch")). withProperty(doap("name")). andTypedLiteral(context.branchName(),XSD.STRING_TYPE). withProperty(scm("hasCommit")). andVariable(COMMIT). forVariable(COMMIT). withProperty(RDF.TYPE). andResource(scm("Commit")). withProperty(scm("commitId")). andTypedLiteral(context.commitId(),XSD.STRING_TYPE));
private void completeJob(final RequestJob job, final URI executionResource) { final EnrichmentContext ctx = job.context(); boolean completed=false; try { submitEnrichmentRequest(ctx,UseCase.createRequest(executionResource,ctx)); completed=true; } catch (final Exception e) { LOGGER.error("Could not process {} ({}). Full stacktrace follows",ctx.pendingEnrichment(),executionResource,e); } finally { LOGGER.trace("{} processing job {}",completed?"Completed ":"Failed ",job.description()); EnrichmentRequestor.this.metrics.jobProcessed(job,completed); } }