Search in sources :

Example 1 with PDSProdutParameterSetup

use of com.mercedesbenz.sechub.pds.config.PDSProdutParameterSetup in project sechub by mercedes-benz.

the class PDSExecutionEnvironmentService method addJobParamDataWhenAccepted.

private void addJobParamDataWhenAccepted(PDSProductSetup productSetup, PDSExecutionParameterEntry jobParam, Map<String, String> map) {
    PDSProdutParameterSetup params = productSetup.getParameters();
    boolean acceptedParameter = false;
    boolean wellknown = false;
    for (PDSConfigDataKeyProvider provider : PDSConfigDataKeyProvider.values()) {
        ExecutionPDSKey key = provider.getKey();
        if (!key.getId().equals(jobParam.getKey())) {
            continue;
        }
        wellknown = true;
        acceptedParameter = key.isAvailableInsideScript();
        break;
    }
    acceptedParameter = acceptedParameter || isJobParameterAcceptedByPDSServerConfiguration(jobParam, params.getMandatory());
    acceptedParameter = acceptedParameter || isJobParameterAcceptedByPDSServerConfiguration(jobParam, params.getOptional());
    if (acceptedParameter) {
        map.put(converter.convertKeyToEnv(jobParam.getKey()), jobParam.getValue());
    } else {
        if (wellknown) {
            LOG.debug("Wellknown parameter found - but not available inside script: {}", jobParam.getKey());
        } else {
            LOG.warn("Ignored invalid job parameter key: {} for product id: {} !", jobParam.getKey(), productSetup.getId());
        }
    }
}
Also used : PDSConfigDataKeyProvider(com.mercedesbenz.sechub.commons.pds.PDSConfigDataKeyProvider) ExecutionPDSKey(com.mercedesbenz.sechub.commons.pds.ExecutionPDSKey) PDSProdutParameterSetup(com.mercedesbenz.sechub.pds.config.PDSProdutParameterSetup)

Aggregations

ExecutionPDSKey (com.mercedesbenz.sechub.commons.pds.ExecutionPDSKey)1 PDSConfigDataKeyProvider (com.mercedesbenz.sechub.commons.pds.PDSConfigDataKeyProvider)1 PDSProdutParameterSetup (com.mercedesbenz.sechub.pds.config.PDSProdutParameterSetup)1