Search in sources :

Example 1 with CIParameters

use of com.hp.octane.integrations.dto.parameters.CIParameters in project octane-ci-java-sdk by MicroFocus.

the class TasksProcessorImpl method executePipelineRunStopRequest.

private void executePipelineRunStopRequest(OctaneResultAbridged result, String jobId, String originalBody) {
    logger.info(configurer.octaneConfiguration.getLocationForLog() + "RunStop job " + jobId);
    CIParameters ciParameters = originalBody != null ? DTOFactory.getInstance().dtoFromJson(originalBody, CIParameters.class) : null;
    configurer.pluginServices.stopPipelineRun(jobId, ciParameters);
    result.setStatus(HttpStatus.SC_OK);
}
Also used : CIParameters(com.hp.octane.integrations.dto.parameters.CIParameters)

Example 2 with CIParameters

use of com.hp.octane.integrations.dto.parameters.CIParameters in project octane-ci-java-sdk by MicroFocus.

the class TasksProcessorImpl method executePipelineRunExecuteRequest.

private void executePipelineRunExecuteRequest(OctaneResultAbridged result, String jobId, String originalBody) {
    logger.info(configurer.octaneConfiguration.getLocationForLog() + "RunExecute job " + jobId);
    // test runner started from here, so it will be added to cache
    configurationService.addToOctaneRootsCache(jobId);
    CIParameters ciParameters = originalBody != null ? DTOFactory.getInstance().dtoFromJson(originalBody, CIParameters.class) : null;
    if (ciParameters == null) {
        ciParameters = dtoFactory.newDTO(CIParameters.class);
        ciParameters.setParameters(new ArrayList<>());
    }
    CIParameter ciParameter = dtoFactory.newDTO(CIParameter.class);
    ciParameter.setName(SdkConstants.JobParameters.OCTANE_CONFIG_ID_PARAMETER_NAME).setValue(configurer.octaneConfiguration.getInstanceId());
    ciParameters.getParameters().add(ciParameter);
    CIParameter octaneUrlParameter = dtoFactory.newDTO(CIParameter.class);
    octaneUrlParameter.setName(SdkConstants.JobParameters.OCTANE_URL_PARAMETER_NAME).setValue(configurer.octaneConfiguration.getUrl());
    ciParameters.getParameters().add(octaneUrlParameter);
    configurer.pluginServices.runPipeline(jobId, ciParameters);
    result.setStatus(HttpStatus.SC_CREATED);
}
Also used : CIParameters(com.hp.octane.integrations.dto.parameters.CIParameters) CIParameter(com.hp.octane.integrations.dto.parameters.CIParameter)

Aggregations

CIParameters (com.hp.octane.integrations.dto.parameters.CIParameters)2 CIParameter (com.hp.octane.integrations.dto.parameters.CIParameter)1