diff options
Diffstat (limited to 'restapi-call-node')
4 files changed, 24 insertions, 95 deletions
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 @@ <packaging>bundle</packaging> <name>ccsdk-sli-plugins :: restapi-call-node :: ${project.artifactId}</name> - <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> @@ -27,11 +26,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-common</artifactId> </dependency> @@ -44,14 +38,6 @@ <artifactId>slf4j-api</artifactId> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - </dependency> - <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> </dependency> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ============LICENSE_START======================================================= - openECOMP : SDN-C - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property. All rights - reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - --> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - - <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> - <property name="locations"> - <list> - <value>file:${SDNC_CONFIG_DIR}/ueb.properties</value> - <value>file:${SDNC_CONFIG_DIR}/dme2.properties</value> - </list> - </property> - <property name="ignoreResourceNotFound" value="true" /> - <property name="ignoreUnresolvablePlaceholders" value="true" /> - </bean> - - <!-- context:property-placeholder location="file:${SDNC_CONFIG_DIR}/ueb.properties" /--> - - <bean id="restapiCallNode" class="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode"> - <property name="uebServers" value="${servers}" /> - <property name="retryPolicyStore" ref="retryPolicyStore"/> - </bean> - - <bean id="retryPolicyStore" class="org.onap.ccsdk.sli.plugins.restapicall.RetryPolicyStore"> - <property name="proxyServers" value="${proxyUrl}" /> - </bean> -</beans> 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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============LICENSE_START======================================================= - openECOMP : SDN-C - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property. All rights - reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - --> - -<beans:beans xmlns="http://www.springframework.org/schema/osgi" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" - xsi:schemaLocation="http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - - <service ref="restapiCallNode" interface="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" /> - -</beans:beans> |