update sparky with configurable features
[aai/sparky-be.git] / sparkybe-onap-service / src / main / java / org / onap / aai / sparky / viewandinspect / config / VisualizationConfigs.java
index b0834ca..80328d3 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.aai.sparky.viewandinspect.config;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 
 import org.onap.aai.sparky.config.SparkyResourceLoader;
 
@@ -47,16 +48,12 @@ public class VisualizationConfigs {
   
   private ArrayList<String> shallowEntities;
   
-  private boolean gizmoEnabled;
-  
   private SparkyResourceLoader resourceLoader;
 
   /**
    * Instantiates a new visualization config.
    */
-  public VisualizationConfigs() {
-         this.gizmoEnabled = false;
-  }
+  public VisualizationConfigs() {}
 
   public ArrayList<String> getShallowEntities() {
     return shallowEntities;
@@ -65,6 +62,22 @@ public class VisualizationConfigs {
   public void setShallowEntities(ArrayList<String> shallowEntities) {
     this.shallowEntities = shallowEntities;
   }
+  
+  public void setDelimitedShallowEntities(String delimitedShallowEntites) {
+
+    if (delimitedShallowEntites == null) {
+      this.shallowEntities = new ArrayList<>();
+      return;
+    }
+
+    try {
+      this.shallowEntities =
+          new ArrayList<String>(Arrays.asList(delimitedShallowEntites.split(",")));
+    } catch (Exception exc) {
+      this.shallowEntities = new ArrayList<>();
+    }
+
+  }
 
   /**
    * Make all neighbors bidirectional.
@@ -135,14 +148,6 @@ public class VisualizationConfigs {
     this.numOfThreadsToFetchNodeIntegrity = numOfThreadsToFetchNodeIntegrity;
   }
 
-       public boolean isGizmoEnabled() {
-               return gizmoEnabled;
-       }
-
-       public void setGizmoEnabled(boolean gizmoEnabled) {
-               this.gizmoEnabled = gizmoEnabled;
-       }
-
   public SparkyResourceLoader getResourceLoader() {
     return resourceLoader;
   }
@@ -152,19 +157,22 @@ public class VisualizationConfigs {
   }
 
   @Override
-       public String toString() {
-               return "VisualizationConfigs [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth
-                               + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", "
-                               + (aaiEntityNodeDescriptors != null ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", "
-                                               : "")
-                               + (generalNodeClassName != null ? "generalNodeClassName=" + generalNodeClassName + ", " : "")
-                               + (searchNodeClassName != null ? "searchNodeClassName=" + searchNodeClassName + ", " : "")
-                               + (selectedSearchedNodeClassName != null
-                                               ? "selectedSearchedNodeClassName=" + selectedSearchedNodeClassName + ", " : "")
-                               + "numOfThreadsToFetchNodeIntegrity=" + numOfThreadsToFetchNodeIntegrity
-                               + ", makeAllNeighborsBidirectional=" + makeAllNeighborsBidirectional + ", "
-                               + (shallowEntities != null ? "shallowEntities=" + shallowEntities + ", " : "") + "gizmoEnabled="
-                               + gizmoEnabled + "]";
-       }
+  public String toString() {
+    return "VisualizationConfigs [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth
+        + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", "
+        + (aaiEntityNodeDescriptors != null
+            ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", " : "")
+        + (generalNodeClassName != null ? "generalNodeClassName=" + generalNodeClassName + ", "
+            : "")
+        + (searchNodeClassName != null ? "searchNodeClassName=" + searchNodeClassName + ", " : "")
+        + (selectedSearchedNodeClassName != null
+            ? "selectedSearchedNodeClassName=" + selectedSearchedNodeClassName + ", " : "")
+        + "numOfThreadsToFetchNodeIntegrity=" + numOfThreadsToFetchNodeIntegrity
+        + ", makeAllNeighborsBidirectional=" + makeAllNeighborsBidirectional + ", "
+        + (shallowEntities != null ? "shallowEntities=" + shallowEntities + ", " : "")
+        + (resourceLoader != null ? "resourceLoader=" + resourceLoader : "") + "]";
+  }
+
 
 }