summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2022-09-14 13:29:47 +0000
committerGerrit Code Review <gerrit@onap.org>2022-09-14 13:29:47 +0000
commit475ac067ec2e913c4821a19a4415858704b79844 (patch)
treee480b23f8576e33eb61ff361ba7a70c9cfbba6a6
parent55f36008180f8657428efa7e6b7e53602f0d6d78 (diff)
parent812cf9a5f6ae7140be475342f19833a2e213c1ae (diff)
Merge "[sli/core/sliPlutinUtils] Adding Extra Constraint Filtering on ShortestPathCompute"
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/DijkstraGraphSearch.java1
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/Edge.java6
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/Link.java6
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/LogicalLink.java9
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/OtnLink.java1
-rw-r--r--core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/PInterface.java4
-rw-r--r--core/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliTopologyUtilsTest.java6
7 files changed, 30 insertions, 3 deletions
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/DijkstraGraphSearch.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/DijkstraGraphSearch.java
index 11611346b..23b34f8d2 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/DijkstraGraphSearch.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/DijkstraGraphSearch.java
@@ -332,6 +332,7 @@ public class DijkstraGraphSearch<V extends Vertex, E extends Edge<V>> {
// If the vertex is reachable, relax all its egress edges.
for (E e : graph.getEdgesFrom(nearest)) {
+ if (!e.isPermitted(src, dst)) continue;
result.relaxEdge(e, cost, weigher, true);
}
}
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/Edge.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/Edge.java
index b178072c2..cf96e7d0c 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/Edge.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/Edge.java
@@ -16,4 +16,10 @@ public interface Edge<V extends Vertex> {
*/
V dst();
+ /**
+ * Returns true if edge is permissable
+ */
+ default boolean isPermitted(V src, V dst){
+ return true;
+ }
}
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/Link.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/Link.java
index fe6ec1c4f..0ace9de5d 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/Link.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/Link.java
@@ -6,4 +6,10 @@ public interface Link {
OTN,
ETH
}
+
+ PInterface src();
+
+ PInterface dst();
+
+ boolean isInnerDomain();
}
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/LogicalLink.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/LogicalLink.java
index 47b43e849..9a9c95798 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/LogicalLink.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/LogicalLink.java
@@ -33,6 +33,15 @@ public class LogicalLink implements Edge<Pnf> {
}
@Override
+ public boolean isPermitted(Pnf src, Pnf dst) {
+ String curSrcName = src().toString();
+ String curDstName = dst().toString();
+ return link.isInnerDomain()
+ || !curSrcName.equals(src.toString()) && !curDstName.equals(dst.toString())
+ && !curSrcName.equals(dst.toString()) && !curDstName.equals(src.toString());
+ }
+
+ @Override
public int hashCode() {
return link.hashCode();
}
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/OtnLink.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/OtnLink.java
index 553a9bd26..6a0fe3cee 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/OtnLink.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/OtnLink.java
@@ -29,6 +29,7 @@ public class OtnLink implements Link{
return linkName;
}
+ @Override
public boolean isInnerDomain(){
if (src != null && dst != null){
if (src.pInterfaceName() != null && dst.pInterfaceName() != null){
diff --git a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/PInterface.java b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/PInterface.java
index 6b111871d..20aee11a7 100644
--- a/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/PInterface.java
+++ b/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/topology/PInterface.java
@@ -16,6 +16,10 @@ public class PInterface {
return pInterfaceName;
}
+ public String pnfName() {
+ return pnfName;
+ }
+
@Override
public int hashCode(){
return Objects.hash(pnfName, pInterfaceName);
diff --git a/core/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliTopologyUtilsTest.java b/core/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliTopologyUtilsTest.java
index 5937e2330..2a009fecb 100644
--- a/core/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliTopologyUtilsTest.java
+++ b/core/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/SliTopologyUtilsTest.java
@@ -56,10 +56,10 @@ public class SliTopologyUtilsTest {
param.put("pnfs-pfx", "ccsdkTopopnfs");
param.put("links-pfx", "ccsdkTopologicalLinks");
param.put("response-pfx", "prefix");
- param.put("output-end-to-end-path", "false");
+ param.put("output-end-to-end-path", "true");
- param.put("src-node","networkId-providerId-30-clientId-0-topologyId-1-nodeId-10.3.1.1" );
- param.put("dst-node", "networkId-providerId-50-clientId-0-topologyId-1-nodeId-10.5.1.4");
+ param.put("src-node","networkId-providerId-30-clientId-0-topologyId-1-nodeId-10.3.1.3" );
+ param.put("dst-node", "networkId-providerId-50-clientId-0-topologyId-1-nodeId-10.5.1.2");
SliTopologyUtils.computePath(param, ctx);
//SliPluginUtils.logContextMemory(ctx, LOG, SliPluginUtils.LogLevel.INFO);