summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider/provider
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/data-provider/provider')
-rw-r--r--sdnr/wt/data-provider/provider/pom.xml7
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java7
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderConfig.java13
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java2
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DataProviderYangToolsMapper.java4
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestImplementation.java26
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java10
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java8
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java2
-rw-r--r--sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java4
10 files changed, 64 insertions, 19 deletions
diff --git a/sdnr/wt/data-provider/provider/pom.xml b/sdnr/wt/data-provider/provider/pom.xml
index 526d59626..38623b65f 100644
--- a/sdnr/wt/data-provider/provider/pom.xml
+++ b/sdnr/wt/data-provider/provider/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.5.4</version>
+ <version>2.6.0</version>
<relativePath/>
</parent>
@@ -145,6 +145,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>netconf-topology</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>7.0.0</version>
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java
index ef2dbcb94..55456a9c6 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/ODLVersionLUT.java
@@ -32,6 +32,9 @@ public class ODLVersionLUT {
if (onapCCSDKVersion == null) {
return def;
}
+ if (onapCCSDKVersion.startsWith("2.6.")) {
+ return "ONAP Montreal";
+ }
if (onapCCSDKVersion.startsWith("2.5.")) {
return "ONAP London";
}
@@ -72,6 +75,10 @@ public class ODLVersionLUT {
}
if(odlMdsalVersionLUT==null) {
odlMdsalVersionLUT = new HashMap<>();
+ odlMdsalVersionLUT.put("11.0.9","argon-SR1 (0.18.1)");
+ odlMdsalVersionLUT.put("11.0.7","argon-SR0 (0.18.0)");
+ odlMdsalVersionLUT.put("10.0.8","chlorine-SR3 (0.17.3)");
+ odlMdsalVersionLUT.put("10.0.6","chlorine-SR2 (0.17.2)");
odlMdsalVersionLUT.put("10.0.5","chlorine-SR1 (0.17.1)");
odlMdsalVersionLUT.put("10.0.2","chlorine-SR0 (0.17.0)");
odlMdsalVersionLUT.put("9.0.5","sulfur-SR2 (0.16.2)");
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderConfig.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderConfig.java
index 950c8e919..9ecc68093 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderConfig.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderConfig.java
@@ -35,6 +35,8 @@ public class DataProviderConfig implements Configuration {
private static final String PROPERTY_KEY_DBENABLED = "enabled";
private static final String DEFAULT_ISENABLED = "${SDNRDBENABLED}";
private static final boolean DEFAULT_ISENABLED_IFNOTSET = true;
+ private static final String PROPERTY_KEY_GUICUTTHROUGH_OVERWRITE = "GUICUTTHROUGH_PROXY_OVERWRITE";
+ private static final String DEFAULT_GUICUTTHROUGH_OVERWRITE = "${GUICUTTHROUGH_PROXY_OVERWRITE}";
private final EsConfig esConfig;
private final SqlDBConfig maridadbConfig;
private ConfigurationFileRepresentation configuration;
@@ -55,17 +57,21 @@ public class DataProviderConfig implements Configuration {
}
public boolean isEnabled() {
- final String s = this.configuration.getProperty(ConfigurationFileRepresentation.SECTIONNAME_ROOT, PROPERTY_KEY_DBENABLED);
- if(s!= null && !s.isBlank()) {
+ final String s = this.configuration.getProperty(ConfigurationFileRepresentation.SECTIONNAME_ROOT,
+ PROPERTY_KEY_DBENABLED);
+ if (s != null && !s.isBlank()) {
return Boolean.getBoolean(s);
}
return DEFAULT_ISENABLED_IFNOTSET;
}
+
@Override
public void defaults() {
configuration.setPropertyIfNotAvailable(this.getSectionName(), PROPERTY_KEY_DBTYPE, DEFAULT_DBTYPE);
configuration.setPropertyIfNotAvailable(this.getSectionName(), PROPERTY_KEY_DBENABLED, DEFAULT_ISENABLED);
+ configuration.setPropertyIfNotAvailable(this.getSectionName(), PROPERTY_KEY_GUICUTTHROUGH_OVERWRITE,
+ DEFAULT_GUICUTTHROUGH_OVERWRITE);
}
@Override
@@ -81,5 +87,8 @@ public class DataProviderConfig implements Configuration {
return SdnrDbType.valueOf(value);
}
+ public String getGuicutthroughOverride() {
+ return this.configuration.getProperty(this.getSectionName(), PROPERTY_KEY_GUICUTTHROUGH_OVERWRITE);
+ }
}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
index d21d50f83..1b1990159 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderServiceImpl.java
@@ -154,7 +154,7 @@ public class DataProviderServiceImpl implements DataProviderService, AutoCloseab
if (this.dbConfig.getDbType() == SdnrDbType.ELASTICSEARCH) {
this.dataProvider = new ElasticSearchDataProvider(this.dbConfig.getEsConfig());
} else {
- this.dataProvider = new SqlDBDataProvider(this.dbConfig.getMariadbConfig());
+ this.dataProvider = new SqlDBDataProvider(this.dbConfig.getMariadbConfig(), this.dbConfig.getGuicutthroughOverride());
}
}
else {
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DataProviderYangToolsMapper.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DataProviderYangToolsMapper.java
index 78b032e77..4137295bc 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DataProviderYangToolsMapper.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/yangtools/DataProviderYangToolsMapper.java
@@ -23,8 +23,8 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools;
import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapper;
import org.onap.ccsdk.features.sdnr.wt.yang.mapper.serialize.IdentifierDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.Credentials;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.LoginPasswordBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.MeasurementKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestImplementation.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestImplementation.java
index 3c983e7a7..91f64185b 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestImplementation.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestImplementation.java
@@ -21,6 +21,8 @@
*/
package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
+import com.google.common.collect.ClassToInstanceMap;
+import org.eclipse.jdt.annotation.NonNull;
import static org.junit.Assert.fail;
import java.util.Set;
import org.junit.Test;
@@ -34,7 +36,9 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.impl.DataProviderImpl;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.StatusChangedHandler.StatusKey;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.Rpc;
import org.opendaylight.yangtools.yang.binding.RpcService;
/**
@@ -64,6 +68,28 @@ public class TestImplementation {
}
@Override
+ public @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation) {
+ return null;
+ }
+
+ @Override
+ public @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation,
+ Set<InstanceIdentifier<?>> paths) {
+ return null;
+ }
+
+ @Override
+ public @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations) {
+ return null;
+ }
+
+ @Override
+ public @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations,
+ Set<InstanceIdentifier<?>> paths) {
+ return null;
+ }
+
+ @Override
public <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
T implementation) {
return null;
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java
index 85db4b2a0..0c4b6bcc9 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestNetconfNodeBuilder.java
@@ -22,11 +22,11 @@
package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.Credentials;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.LoginPassword;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNodeBuilder;
@SuppressWarnings("deprecation")
public class TestNetconfNodeBuilder {
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
index ed6642a6f..ded61f656 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMapping.java
@@ -45,10 +45,10 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.DataProviderYangTo
import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapperHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.parameters.OdlHelloMessageCapabilitiesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.parameters.OdlHelloMessageCapabilitiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.LoginPasswordBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNodeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.CreateMediatorServerInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EntityInput;
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java
index 0192b47db..d7e727f9b 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/TestYangGenSalMappingOpenRoadm.java
@@ -35,7 +35,6 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.YangHelper2;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.yangtools.DataProviderYangToolsMapper;
import org.onap.ccsdk.features.sdnr.wt.yang.mapper.YangToolsMapper2;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataTypeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.BIPErrorCounter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.DelayTCM2Up;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.OpticalPowerInputOSCMin;
@@ -106,7 +105,6 @@ public class TestYangGenSalMappingOpenRoadm extends Mockito {
@Test
public void testOpenroadmPMString2() throws IOException, ClassNotFoundException {
out("Test: " + method());
- PmDataTypeBuilder.getDefaultInstance("11298624220985537708");
String jsonString2 = getFileContent("pmdata2.json");
DataProviderYangToolsMapper mapper2 = new DataProviderYangToolsMapper();
PmdataEntity generatepmdNode = mapper2.readValue(jsonString2, PmdataEntity.class);
diff --git a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
index 7d71571d4..93deaa3a3 100644
--- a/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
+++ b/sdnr/wt/data-provider/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/test/util/MariaDBTestBase.java
@@ -83,7 +83,7 @@ public class MariaDBTestBase {
});
SqlDBConfig config = new SqlDBConfig(new ConfigurationFileRepresentation("test.properties"));
this.db = null;
- this.dbProvider = new SqlDBDataProvider(config);
+ this.dbProvider = new SqlDBDataProvider(config, "");
testCreateTable(this.dbProvider.getDBService());
}
@@ -97,7 +97,7 @@ public class MariaDBTestBase {
//start db server
this.db = startDatabase(port);
//create db with name sdnrdb
- this.dbProvider = new SqlDBDataProvider(config);
+ this.dbProvider = new SqlDBDataProvider(config, "");
testCreateTable(this.dbProvider.getDBService());
}