Search in sources :

Example 1 with BuildTaskContext

use of org.jboss.pnc.common.logging.BuildTaskContext in project pnc by project-ncl.

the class BuildExecutorTriggerer method getMdcMeta.

public Optional<BuildTaskContext> getMdcMeta(String buildExecutionConfigId, String userId) {
    BuildExecutionSession runningExecution = buildExecutor.getRunningExecution(buildExecutionConfigId);
    if (runningExecution != null) {
        BuildExecutionConfiguration buildExecutionConfiguration = runningExecution.getBuildExecutionConfiguration();
        boolean temporaryBuild = buildExecutionConfiguration.isTempBuild();
        return Optional.of(new BuildTaskContext(buildExecutionConfiguration.getBuildContentId(), userId, temporaryBuild, ExpiresDate.getTemporaryBuildExpireDate(systemConfig.getTemporaryBuildsLifeSpan(), temporaryBuild)));
    } else {
        return Optional.empty();
    }
}
Also used : BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) BuildTaskContext(org.jboss.pnc.common.logging.BuildTaskContext) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration)

Aggregations

BuildTaskContext (org.jboss.pnc.common.logging.BuildTaskContext)1 BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)1 BuildExecutionSession (org.jboss.pnc.spi.executor.BuildExecutionSession)1