Updated SDC listener and dependent bundles
[appc.git] / appc-dg / appc-dg-shared / appc-dg-dependency-model / src / main / java / org / onap / appc / dg / flowbuilder / impl / ReverseFlowStrategy.java
index 79cd442..72b88f6 100644 (file)
@@ -26,14 +26,14 @@ package org.onap.appc.dg.flowbuilder.impl;
 
 import java.util.*;
 
-import org.onap.appc.dg.flowbuilder.exception.InvalidDependencyModel;
+import org.onap.appc.dg.flowbuilder.exception.InvalidDependencyModelException;
 import org.onap.appc.domainmodel.Vnfc;
 
 
 public class ReverseFlowStrategy extends AbstractFlowStrategy {
 
     @Override
-    protected List<List<Vnfc>> orderDependencies() {
+    protected List<List<Vnfc>> orderDependencies() throws InvalidDependencyModelException{
         ArrayList<List<Vnfc>> arrayList = new ArrayList<>();
 
         Queue<Vnfc> queue1 = new LinkedList();
@@ -54,7 +54,7 @@ public class ReverseFlowStrategy extends AbstractFlowStrategy {
             }
         }
         if(queue1.isEmpty()){
-            throw new InvalidDependencyModel("There seems to be no leaf node for Vnfc dependencies");
+            throw new InvalidDependencyModelException("There seems to be no leaf node for Vnfc dependencies");
         }
         arrayList.add((List<Vnfc>)queue1);
         queue1 = new LinkedList<>(queue1);
@@ -87,7 +87,7 @@ public class ReverseFlowStrategy extends AbstractFlowStrategy {
                 if(arrayList.size()>graph.getSize()){
                     // dependency list cannot be larger than total number of nodes
                     // if it happens indicates cycle in the dependency
-                    throw new InvalidDependencyModel("Cycle detected in the VNFC dependencies");
+                    throw new InvalidDependencyModelException("Cyclic dependency detected between the VNFCs");
                 }
                 queue1.addAll(queue2);
                 queue2 = new LinkedHashSet<>();