summaryrefslogtreecommitdiffstats
path: root/sdnr
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr')
-rw-r--r--sdnr/wt-odlux/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts4
-rw-r--r--sdnr/wt-odlux/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts2
-rw-r--r--sdnr/wt/data-provider/dblib/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/database/sqldb/data/SqlDBDataProvider.java47
-rwxr-xr-xsdnr/wt/data-provider/installer/pom.xml3
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java11
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java5
6 files changed, 43 insertions, 29 deletions
diff --git a/sdnr/wt-odlux/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts b/sdnr/wt-odlux/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
index 948f2aada..2942c1a4c 100644
--- a/sdnr/wt-odlux/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
+++ b/sdnr/wt-odlux/odlux/apps/connectApp/src/actions/commonNetworkElementsActions.ts
@@ -82,7 +82,7 @@ export const findWebUrisForGuiCutThroughAsyncAction = (networkElementIds: string
networkElementIds.forEach(id => {
const item = networkElements.rows.find((ne) => ne.id === id);
if (item) {
- if (item.status === 'Connected') {
+ if (item.status) {
// if (item.coreModelCapability !== "Unsupported") {
// element is connected and is added to search list, if it doesn't exist already
@@ -118,7 +118,7 @@ export const findWebUrisForGuiCutThroughAsyncAction = (networkElementIds: string
});
- if (elementsToSearch.length > 0 || notConnectedElements.length > 0 || unsupportedElements.length > 0) {
+ if (elementsToSearch.length > 0 || unsupportedElements.length > 0) {
const result = await connectService.getAllWebUriExtensionsForNetworkElementListAsync(elementsToSearch);
dispatcher(new AddWebUriList(result, notConnectedElements, unsupportedElements, prevFoundElements));
}
diff --git a/sdnr/wt-odlux/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts b/sdnr/wt-odlux/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
index 42d2824b9..71d62f94b 100644
--- a/sdnr/wt-odlux/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
+++ b/sdnr/wt-odlux/odlux/apps/connectApp/src/handlers/networkElementsHandler.ts
@@ -42,7 +42,7 @@ export const {
appState.connect.networkElements.rows.forEach(element => {
- if (element.status === 'Connected') {
+ if (element.status) {
const webUri = webUris.find(item => item.id === element.id as string);
if (webUri) {
element.weburi = webUri.weburi;
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 e04e109cd..02930304b 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
@@ -28,6 +28,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.SqlDBClient;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.database.sqldb.SqlDBConfig;
@@ -87,6 +88,7 @@ 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.UpdateNetworkElementConnectionInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.UpdateNetworkElementConnectionOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.Filter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.entity.input.FilterKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.mediator.server.list.output.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -474,27 +476,27 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
@Override
public ReadGuiCutThroughEntryOutputBuilder readGuiCutThroughEntry(EntityInput input) {
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);
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());
+ if (input.getFilter() != null) {
+ // Iterate through the Filter map, get the ID and populate the GuicutThrough object accordingly.
+ Map<FilterKey, Filter> inputFilter = input.getFilter();
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> gcData =
+ new ArrayList<>();
+ for (FilterKey fk : inputFilter.keySet()) {
+ String fkVal = inputFilter.get(fk).getFiltervalue();
+ if (fkVal != null) {
+ addGcItem(gcData, fkVal);
+ }
+ for (String fkVals : inputFilter.get(fk).getFiltervalues()) {
+ addGcItem(gcData, fkVals);
+ }
+ }
+ outputBuilder.setData(gcData);
}
- outputBuilder.setData(updatedGcData);
} else {
+ 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());
}
outputBuilder.setPagination(
@@ -503,6 +505,17 @@ public class SqlDBDataProvider extends HtDatabaseEventsService implements Databa
return outputBuilder;
}
+ private void addGcItem(
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.read.gui.cut.through.entry.output.Data> gcData,
+ String value) {
+ Guicutthrough gcItem = new GuicutthroughBuilder().setId(value).setName(value)
+ .setWeburi(guicutthroughOverride + "/" + value).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);
+ gcData.add(gcDataBuilder.build());
+ }
+
@Override
public boolean waitForYellowDatabaseStatus(long timeout, TimeUnit unit) {
return true;
diff --git a/sdnr/wt/data-provider/installer/pom.xml b/sdnr/wt/data-provider/installer/pom.xml
index d00d57b3c..01c4139be 100755
--- a/sdnr/wt/data-provider/installer/pom.xml
+++ b/sdnr/wt/data-provider/installer/pom.xml
@@ -22,6 +22,7 @@
~ ============LICENSE_END=======================================================
~
-->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -48,7 +49,7 @@
<dependency>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>installed-odl-bom</artifactId>
- <version>2.6.0</version>
+ <version>2.7.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java
index 2f7b9e3fc..39239fdf7 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/DataTreeHttpServlet.java
@@ -32,7 +32,6 @@ import java.util.List;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -41,9 +40,6 @@ import org.json.JSONObject;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.InventoryTreeProvider;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.DataTreeObject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Entity;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName;
-import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,12 +48,13 @@ import org.slf4j.LoggerFactory;
*
*/
-@HttpWhiteboardServletPattern("/tree/*")
-@HttpWhiteboardServletName("DataTreeHttpServlet")
-@Component(service = Servlet.class)
+//@HttpWhiteboardServletPattern("/tree/*")
+//@HttpWhiteboardServletName("DataTreeHttpServlet")
+//@Component(service = Servlet.class)
public class DataTreeHttpServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
+ public static final String URI_PRE = "/tree";
private InventoryTreeProvider dataTreeProvider;
private static final Logger LOG = LoggerFactory.getLogger(DataTreeHttpServlet.class);
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java
index 71ff7a85b..d7ae4cc51 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataProviderImpl.java
@@ -102,7 +102,9 @@ public class DataProviderImpl implements IEntityDataProvider, AutoCloseable {
public void onUnbindService(HttpService httpService) {
httpService.unregister(AboutHttpServlet.URI_PRE);
+ httpService.unregister(DataTreeHttpServlet.URI_PRE);
this.aboutServlet = null;
+ this.treeServlet = null;
}
public void onBindService(HttpService httpService)
@@ -111,7 +113,8 @@ public class DataProviderImpl implements IEntityDataProvider, AutoCloseable {
LOG.warn("Unable to inject HttpService into loader.");
} else {
httpService.registerServlet(AboutHttpServlet.URI_PRE, aboutServlet, null, null);
- LOG.info("about servlet registered.");
+ httpService.registerServlet(DataTreeHttpServlet.URI_PRE, treeServlet, null, null);
+ LOG.info("about servlet and tree servlet registered.");
}
}