From: Smokowski, Kevin (ks6305) Date: Tue, 14 Aug 2018 14:43:31 +0000 (+0000) Subject: dme2 & ueb support X-Git-Tag: 0.3.0~14 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=f4817b420b59de111a0abe1eec761bd3e4458530;p=ccsdk%2Fsli%2Fplugins.git dme2 & ueb support fix dme2 & ueb support in rest api call node Change-Id: Ia387c0be8e907900e0b808879582048624dbef36 Issue-ID: CCSDK-459 Signed-off-by: Smokowski, Kevin (ks6305) --- diff --git a/restapi-call-node/provider/pom.xml b/restapi-call-node/provider/pom.xml index 18a20cef..6670cfd8 100755 --- a/restapi-call-node/provider/pom.xml +++ b/restapi-call-node/provider/pom.xml @@ -14,7 +14,6 @@ bundle ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId} - http://maven.apache.org UTF-8 @@ -26,11 +25,6 @@ junit test - - org.springframework - spring-test - test - org.onap.ccsdk.sli.core sli-common @@ -43,14 +37,6 @@ org.slf4j slf4j-api - - org.springframework - spring-beans - - - org.springframework - spring-context - com.sun.jersey jersey-client diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 42462f0e..46c74ff8 100644 --- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -37,6 +37,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Properties; import java.util.Set; import javax.net.ssl.HostnameVerifier; @@ -75,6 +76,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { private String uebServers; private String defaultUebTemplateFileName = "/opt/bvc/restapi/templates/default-ueb-message.json"; protected RetryPolicyStore retryPolicyStore; + protected static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties"; + protected static final String UEB_PROPERTIES_FILE_NAME = "ueb.properties"; + protected static final String DEFAULT_PROPERTIES_DIR = "/opt/onap/ccsdk/data/properties"; + protected static final String PROPERTIES_DIR_KEY = "SDNC_CONFIG_DIR"; protected RetryPolicyStore getRetryPolicyStore() { return retryPolicyStore; @@ -85,7 +90,26 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } public RestapiCallNode() { + String configDir = System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR); + + try (FileInputStream in = new FileInputStream(configDir + "/" + DME2_PROPERTIES_FILE_NAME)) { + Properties props = new Properties(); + props.load(in); + this.retryPolicyStore = new RetryPolicyStore(); + this.retryPolicyStore.setProxyServers(props.getProperty("proxyUrl")); + log.info("DME2 support enabled"); + } catch (Exception e) { + log.warn("DME2 properties could not be read, DME2 support will not be enabled.", e); + } + try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) { + Properties props = new Properties(); + props.load(in); + this.uebServers = props.getProperty("servers"); + log.info("UEB support enabled"); + } catch (Exception e) { + log.warn("UEB properties could not be read, UEB support will not be enabled.", e); + } } /** diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml deleted file mode 100644 index 87850624..00000000 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-context.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - file:${SDNC_CONFIG_DIR}/ueb.properties - file:${SDNC_CONFIG_DIR}/dme2.properties - - - - - - - - - - - - - - - - - diff --git a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml b/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml deleted file mode 100644 index 2f1e4dbd..00000000 --- a/restapi-call-node/provider/src/main/resources/META-INF/spring/restapi-call-node-osgi-context.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - -