X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Fconfig%2FModelLoaderConfig.java;h=adc58e537cfcbbe29f1f284decc0c69681a4c42a;hb=211189e641f5b3aef7b02f47d5e82e522c8c592f;hp=7523fce765be5807235193e0e7cb27b37b2848f0;hpb=5fe489423ea9f2a50e85da43581960f70684e069;p=aai%2Fmodel-loader.git diff --git a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java index 7523fce..adc58e5 100644 --- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java @@ -25,6 +25,7 @@ import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Properties; import org.apache.commons.lang3.StringUtils; @@ -56,6 +57,7 @@ public class ModelLoaderConfig implements IConfiguration { protected static final String PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED = PREFIX_DISTRIBUTION_CLIENT + "ASDC_CONNECTION_DISABLE"; protected static final String PROP_ML_DISTRIBUTION_ASDC_ADDRESS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_ADDRESS"; + protected static final String PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_USE_HTTPS"; protected static final String PROP_ML_DISTRIBUTION_CONSUMER_GROUP = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_GROUP"; protected static final String PROP_ML_DISTRIBUTION_CONSUMER_ID = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_ID"; protected static final String PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME = @@ -122,17 +124,13 @@ public class ModelLoaderConfig implements IConfiguration { // Get list of artifact types String types = get(PROP_ML_DISTRIBUTION_ARTIFACT_TYPES); if (types != null) { - for (String artType : types.split(",")) { - artifactTypes.add(artType); - } + artifactTypes.addAll(Arrays.asList(types.split(","))); } // Get list of message bus addresses String addresses = get(PROP_ML_DISTRIBUTION_MSG_BUS_ADDRESSES); if (addresses != null) { - for (String addr : addresses.split(",")) { - msgBusAddrs.add(addr); - } + msgBusAddrs.addAll(Arrays.asList(addresses.split(","))); } } @@ -147,7 +145,7 @@ public class ModelLoaderConfig implements IConfiguration { @Override public boolean activateServerTLSAuth() { String value = get(PROP_ML_DISTRIBUTION_ACTIVE_SERVER_TLS_AUTH); - return value != null && Boolean.parseBoolean(value); + return Boolean.parseBoolean(value); } @Override @@ -155,6 +153,16 @@ public class ModelLoaderConfig implements IConfiguration { return get(PROP_ML_DISTRIBUTION_ASDC_ADDRESS); } + @Override + public Boolean isUseHttpsWithSDC() { + /* if PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS is null, https will be used, as before */ + String value = get(PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS); + if (value == null) { + return true; + } + return Boolean.parseBoolean(value); + } + @Override public String getConsumerGroup() { return get(PROP_ML_DISTRIBUTION_CONSUMER_GROUP); @@ -320,7 +328,7 @@ public class ModelLoaderConfig implements IConfiguration { /** * Read the value of the property and replace any wildcard OXM version "v*" with the supplied default OXM version - * + * * @param propertyName * the name of the property storing the OXM version (possibly containing v*) * @param version