aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/openecomp/vid/properties
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2017-09-04 14:52:07 +0300
committerOfir Sonsino <os0695@att.com>2017-09-04 14:52:07 +0300
commitb35670742c728d7d85da2f9c856c51a5889449d6 (patch)
tree92e544b121b8a47230667f0e0078c188a47dd8eb /vid-app-common/src/main/java/org/openecomp/vid/properties
parent49a483a9b40cb429717ccec69fa99e4908aadbb6 (diff)
[VID-55] Upgrade Tosca Parser (merge)
Change-Id: I5389f1641ef22df3ed569a154b3c367117c04d04 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/openecomp/vid/properties')
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java34
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java21
2 files changed, 28 insertions, 27 deletions
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
index 6d5f9522..232023b4 100755
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
@@ -24,31 +24,36 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
/**
* The Class AsdcClientConfiguration.
*/
@Configuration
-@PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties")
+
+@PropertySources({
+ @PropertySource(value="asdc.properties", ignoreResourceNotFound = true),
+ @PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)
+})
public class AsdcClientConfiguration {
-
- @Bean
- public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
- return new PropertySourcesPlaceholderConfigurer();
+
+ @Bean
+ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
+ return new PropertySourcesPlaceholderConfigurer();
}
@Value("${asdc.client.type}")
private AsdcClientType asdcClientType;
-
+
/** The asdc client host. */
@Value("${asdc.client.rest.host}")
private String asdcClientHost;
-
+
/** The asdc client port. */
@Value("${asdc.client.rest.port}")
private int asdcClientPort;
-
+
/** The asdc client auth. */
@Value("${asdc.client.rest.auth}")
public String asdcClientAuth;
@@ -56,7 +61,7 @@ public class AsdcClientConfiguration {
/** The asdc client protocol. */
@Value("${asdc.client.rest.protocol}")
public String asdcClientProtocol;
-
+
/**
* Gets the asdc client type.
*
@@ -101,16 +106,19 @@ public class AsdcClientConfiguration {
public String getAsdcClientProtocol() {
return asdcClientProtocol;
}
-
+
/**
* The Enum AsdcClientType.
*/
public enum AsdcClientType {
-
+
/** The in memory. */
IN_MEMORY,
-
+
/** The rest. */
- REST
+ REST,
+
+ /** The local. */
+ LOCAL
}
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
index 38062df4..141b9b27 100755
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
@@ -53,27 +53,21 @@ public class VidProperties extends SystemProperties {
*
* @return the property value or a default value
*/
- public static String[] getAsdcModelNamespace() {
+ public static String getAsdcModelNamespace() {
String methodName = "getAsdcModelNamespace ";
- String[] asdcModelNamespaces = null;
- String value = null;
+ String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
try {
- value = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
- if ( value == null || value.isEmpty()) {
- asdcModelNamespaces = new String[1];
- asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+ asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
+ if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {
+ asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
}
- else {
- asdcModelNamespaces = value.split(",");
- }
}
catch ( Exception e ) {
LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
+ ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);
- asdcModelNamespaces = new String[1];
- asdcModelNamespaces[0] = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+ asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
}
- return (asdcModelNamespaces);
+ return (asdcModelNamespace);
}
/**
* Gets the specified property value. If the property is not defined, returns a default value.
@@ -96,5 +90,4 @@ public class VidProperties extends SystemProperties {
}
return (propValue);
}
-
}