summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/data-provider')
-rw-r--r--sdnr/wt/data-provider/dblib/pom.xml17
-rw-r--r--sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java62
-rw-r--r--sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java6
-rw-r--r--sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/util/MariaDBTestBase.java8
-rw-r--r--sdnr/wt/data-provider/dblib/test2.properties7
-rw-r--r--sdnr/wt/data-provider/feature/pom.xml2
-rwxr-xr-xsdnr/wt/data-provider/installer/pom.xml2
-rw-r--r--sdnr/wt/data-provider/model/pom.xml2
-rwxr-xr-xsdnr/wt/data-provider/pom.xml2
-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
-rw-r--r--sdnr/wt/data-provider/setup/pom.xml16
-rw-r--r--sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java4
21 files changed, 157 insertions, 54 deletions
diff --git a/sdnr/wt/data-provider/dblib/pom.xml b/sdnr/wt/data-provider/dblib/pom.xml
index 2897e4ede..39b878bd9 100644
--- a/sdnr/wt/data-provider/dblib/pom.xml
+++ b/sdnr/wt/data-provider/dblib/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>
@@ -123,4 +123,19 @@
<!-- MariaDB end -->
</dependencies>
+ <!-- Tests require MariaDB4j , which does not currently support ARM64 -->
+ <profiles>
+ <profile>
+ <id>disable-test-on-ARM64</id>
+ <activation>
+ <os>
+ <arch>aarch64</arch>
+ </os>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+
</project>
diff --git a/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java b/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java
index d00941d86..e04e109cd 100644
--- a/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java
+++ b/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java
@@ -26,6 +26,7 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.data;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.SqlDBClient;
@@ -56,6 +57,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.DeleteNetworkElementConnectionOutputBuilder;
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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GuicutthroughBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MaintenanceEntity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.MediatorServerEntity;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity;
@@ -88,7 +91,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.pro
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
public class SqlDBDataProvider extends HtDatabaseEventsService implements DatabaseDataProvider {
private static final Logger LOG = LoggerFactory.getLogger(SqlDBDataProvider.class);
@@ -104,7 +106,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
private final SqlDBStatusReader readStatus;
private final HtUserdataManager usermanager;
private final InventoryTreeProvider inventoryTreeProvider;
-
+ private final String guicutthroughOverride;
public SqlDBReaderWriter<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.maintenance.list.output.Data> getMaintenanceReaderWriter() {
return this.maintenanceRW;
@@ -114,12 +116,13 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
return this.mediatorserverRW;
}
- public SqlDBDataProvider(SqlDBConfig config) {
- this(config, true);
+ public SqlDBDataProvider(SqlDBConfig config, String guicutthroughOverride) {
+ this(config, true, guicutthroughOverride);
}
- public SqlDBDataProvider(SqlDBConfig config, boolean initControllerId) {
+ public SqlDBDataProvider(SqlDBConfig config, boolean initControllerId, String guicutthroughOverride) {
super(config);
+ this.guicutthroughOverride = guicutthroughOverride;
this.mediatorserverRW = new SqlDBReaderWriter<>(this.dbClient, Entity.MediatorServer, config.getDbSuffix(),
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data.class,
@@ -139,8 +142,8 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
}
};
this.dbMaintenanceService = new HtDatabaseMaintenanceService(this);
- this.usermanager = new HtUserdataManagerImpl(new SqlDBReaderWriterUserdata(this.dbClient,
- Entity.Userdata, config.getDbSuffix()));
+ this.usermanager = new HtUserdataManagerImpl(
+ new SqlDBReaderWriterUserdata(this.dbClient, Entity.Userdata, config.getDbSuffix()));
if (initControllerId) {
try {
this.setControllerId();
@@ -150,7 +153,6 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
}
this.inventoryTreeProvider = new SqlDbInventoryTreeProvider(this.dbClient, this.getControllerId());
-
}
/*-------------------------
@@ -186,13 +188,12 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
@Override
public ReadCmlogListOutputBuilder readCMLogList(EntityInput input) {
ReadCmlogListOutputBuilder outputBuilder = new ReadCmlogListOutputBuilder();
- QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.Data>
- result =
- this.eventRWCMLog.getData(input);
+ QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.Data> result =
+ this.eventRWCMLog.getData(input);
outputBuilder.setData(result.getResult());
outputBuilder.setPagination(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.PaginationBuilder(
- result.getPagination()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.cmlog.list.output.PaginationBuilder(
+ result.getPagination()).build());
return outputBuilder;
}
@@ -475,15 +476,33 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
ReadGuiCutThroughEntryOutputBuilder outputBuilder = new ReadGuiCutThroughEntryOutputBuilder();
QueryResult<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> result =
this.guicutthroughRW.getData(input);
- outputBuilder.setData(result.getResult());
+
+ if (!guicutthroughOverride.isEmpty()) {
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> gcData =
+ result.getResult();
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> updatedGcData =
+ new ArrayList<>();
+ for (int i = 0; i < gcData.size(); i++) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data gcDataItem =
+ gcData.get(i);
+ Guicutthrough gcItem =
+ new GuicutthroughBuilder().setId(gcDataItem.getId()).setName(gcDataItem.getName())
+ .setWeburi(guicutthroughOverride + "/" + gcDataItem.getId()).build();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.DataBuilder gcDataBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.DataBuilder(
+ gcItem);
+ updatedGcData.add(gcDataBuilder.build());
+ }
+ outputBuilder.setData(updatedGcData);
+ } else {
+ outputBuilder.setData(result.getResult());
+ }
outputBuilder.setPagination(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.PaginationBuilder()
.build());
return outputBuilder;
}
-
-
@Override
public boolean waitForYellowDatabaseStatus(long timeout, TimeUnit unit) {
return true;
@@ -519,8 +538,7 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
return true;
}
LOG.info("set controllerId {}", this.controllerId);
- String query =
- String.format("SELECT * FROM `%s` WHERE `id`='%s'", this.controllerTableName, this.controllerId);
+ String query = String.format("SELECT * FROM `%s` WHERE `id`='%s'", this.controllerTableName, this.controllerId);
LOG.trace(query);
ResultSet data = this.dbClient.read(query);
@@ -528,7 +546,12 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
query = String.format("INSERT INTO `%s` (`id`,`desc`) VALUES ('%s','%s')", this.controllerTableName,
this.controllerId, "");
LOG.trace(query);
- try { if(data!=null){data.close();} } catch (SQLException ignore) { }
+ try {
+ if (data != null) {
+ data.close();
+ }
+ } catch (SQLException ignore) {
+ }
return this.dbClient.write(query);
} else {
this.controllerId = data.getString(0);
@@ -555,5 +578,4 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
return this.inventoryTreeProvider;
}
-
}
diff --git a/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java b/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java
index 8167c7bbf..5755023e1 100644
--- a/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java
+++ b/sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/database/SqlDBMapper.java
@@ -44,7 +44,7 @@ import org.onap.ccsdk.features.sdnr.wt.yang.mapper.mapperextensions.YangToolsDes
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.params.xml.ns.yang.data.provider.rev201110.Entity;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Enumeration;
+import org.opendaylight.yangtools.yang.binding.EnumTypeObject;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
@@ -233,7 +233,7 @@ public class SqlDBMapper {
|| implementsInterface(valueType, Map.class) || implementsInterface(valueType, Set.class)) {
return "JSON";
}
- if (implementsInterface(valueType, Enumeration.class)) {
+ if (implementsInterface(valueType, EnumTypeObject.class)) {
return ENUM_DBTYPE;
}
throw new UnableToMapClassException("no mapping for " + valueType.getName() + " found");
@@ -360,7 +360,7 @@ public class SqlDBMapper {
}
private static boolean isYangEnum(Class<?> valueType) {
- return YangToolsMapperHelper.implementsInterface(valueType, Enumeration.class);
+ return YangToolsMapperHelper.implementsInterface(valueType, EnumTypeObject.class);
}
public static <T extends DataObject> List<T> read(ResultSet data, Class<T> clazz)
diff --git a/sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/util/MariaDBTestBase.java b/sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/util/MariaDBTestBase.java
index 3123d25a6..1da6e6a86 100644
--- a/sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/util/MariaDBTestBase.java
+++ b/sdnr/wt/data-provider/dblib/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/dblib/test/util/MariaDBTestBase.java
@@ -96,12 +96,12 @@ public class MariaDBTestBase {
this.config.setDbSuffix("");
this.config.setControllerId("test123");
this.db = null;
- this.dbProvider = new SqlDBDataProvider(config, false);
+ this.dbProvider = new SqlDBDataProvider(config, false, "");
SqlDBConfig config2 = new SqlDBConfig(new ConfigurationFileRepresentation("test2.properties"));
config2.setDbSuffix("");
config2.setControllerId(null);
- this.dbProviderOverall = new SqlDBDataProvider(config2, false);
+ this.dbProviderOverall = new SqlDBDataProvider(config2, false, "");
}
public MariaDBTestBase(int port) throws ManagedProcessException {
@@ -116,11 +116,11 @@ public class MariaDBTestBase {
//start db server
this.db = startDatabase(port);
//create db with name sdnrdb
- this.dbProvider = new SqlDBDataProvider(config, false);
+ this.dbProvider = new SqlDBDataProvider(config, false, "");
SqlDBConfig config2 = new SqlDBConfig(new ConfigurationFileRepresentation("test2.properties"));
config2.setDbSuffix("");
config2.setControllerId(null);
- this.dbProviderOverall = new SqlDBDataProvider(config2, false);
+ this.dbProviderOverall = new SqlDBDataProvider(config2, false, "");
}
public void close() throws ManagedProcessException {
diff --git a/sdnr/wt/data-provider/dblib/test2.properties b/sdnr/wt/data-provider/dblib/test2.properties
new file mode 100644
index 000000000..e3485ea95
--- /dev/null
+++ b/sdnr/wt/data-provider/dblib/test2.properties
@@ -0,0 +1,7 @@
+[mariadb]
+url=${SDNRDBURL}
+username=${SDNRDBUSERNAME}
+password=${SDNRDBPASSWORD}
+controllerId=null
+suffix=
+
diff --git a/sdnr/wt/data-provider/feature/pom.xml b/sdnr/wt/data-provider/feature/pom.xml
index 6ead9c6d2..1c0eb21d1 100644
--- a/sdnr/wt/data-provider/feature/pom.xml
+++ b/sdnr/wt/data-provider/feature/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.5.4</version>
+ <version>2.6.0</version>
<relativePath/>
</parent>
diff --git a/sdnr/wt/data-provider/installer/pom.xml b/sdnr/wt/data-provider/installer/pom.xml
index c0e009215..2de56eff3 100755
--- a/sdnr/wt/data-provider/installer/pom.xml
+++ b/sdnr/wt/data-provider/installer/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.5.4</version>
+ <version>2.6.0</version>
<relativePath/>
</parent>
diff --git a/sdnr/wt/data-provider/model/pom.xml b/sdnr/wt/data-provider/model/pom.xml
index e87d0637b..d78832edc 100644
--- a/sdnr/wt/data-provider/model/pom.xml
+++ b/sdnr/wt/data-provider/model/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>
diff --git a/sdnr/wt/data-provider/pom.xml b/sdnr/wt/data-provider/pom.xml
index b841f6e8d..0f82f7804 100755
--- a/sdnr/wt/data-provider/pom.xml
+++ b/sdnr/wt/data-provider/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.5.4</version>
+ <version>2.6.0</version>
<relativePath/>
</parent>
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());
}
diff --git a/sdnr/wt/data-provider/setup/pom.xml b/sdnr/wt/data-provider/setup/pom.xml
index c0d8afe72..c75b31a1b 100644
--- a/sdnr/wt/data-provider/setup/pom.xml
+++ b/sdnr/wt/data-provider/setup/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>
@@ -102,6 +102,20 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>
</dependencies>
+ <!-- Tests require MariaDB4j , which does not currently support ARM64 -->
+ <profiles>
+ <profile>
+ <id>disable-test-on-ARM64</id>
+ <activation>
+ <os>
+ <arch>aarch64</arch>
+ </os>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
<build>
<plugins>
<plugin>
diff --git a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
index 2845613cb..671d6225a 100644
--- a/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
+++ b/sdnr/wt/data-provider/setup/src/test/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/MariaDBTestBase.java
@@ -90,7 +90,7 @@ public class MariaDBTestBase {
SqlDBConfig config = new SqlDBConfig(new ConfigurationFileRepresentation(TESTPROPFILE));
config.setControllerId("test123");
this.db = null;
- this.dbProvider = new SqlDBDataProvider(config, false);
+ this.dbProvider = new SqlDBDataProvider(config, false, "");
//testCreateTable(this.dbProvider.getDBService());
}
@@ -104,7 +104,7 @@ public class MariaDBTestBase {
//start db server
this.db = startDatabase(port);
//create db with name sdnrdb
- this.dbProvider = new SqlDBDataProvider(config, false);
+ this.dbProvider = new SqlDBDataProvider(config, false, "");
//testCreateTable(this.dbProvider.getDBService());
}