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());
}
}
}
Aggregations