update sparky with configurable features
[aai/sparky-be.git] / sparkybe-onap-service / src / main / java / org / onap / aai / sparky / viewandinspect / config / VisualizationConfigs.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017-2018 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 package org.onap.aai.sparky.viewandinspect.config;
22
23 import java.util.ArrayList;
24 import java.util.Arrays;
25
26 import org.onap.aai.sparky.config.SparkyResourceLoader;
27
28 /**
29  * The Class VisualizationConfig.
30  */
31 public class VisualizationConfigs {
32
33   private int maxSelfLinkTraversalDepth;
34
35   private boolean visualizationDebugEnabled;
36
37   private String aaiEntityNodeDescriptors;
38
39   private String generalNodeClassName;
40
41   private String searchNodeClassName;
42
43   private String selectedSearchedNodeClassName;
44
45   private int numOfThreadsToFetchNodeIntegrity;
46
47   private boolean makeAllNeighborsBidirectional;
48   
49   private ArrayList<String> shallowEntities;
50   
51   private SparkyResourceLoader resourceLoader;
52
53   /**
54    * Instantiates a new visualization config.
55    */
56   public VisualizationConfigs() {}
57
58   public ArrayList<String> getShallowEntities() {
59     return shallowEntities;
60   }
61
62   public void setShallowEntities(ArrayList<String> shallowEntities) {
63     this.shallowEntities = shallowEntities;
64   }
65   
66   public void setDelimitedShallowEntities(String delimitedShallowEntites) {
67
68     if (delimitedShallowEntites == null) {
69       this.shallowEntities = new ArrayList<>();
70       return;
71     }
72
73     try {
74       this.shallowEntities =
75           new ArrayList<String>(Arrays.asList(delimitedShallowEntites.split(",")));
76     } catch (Exception exc) {
77       this.shallowEntities = new ArrayList<>();
78     }
79
80   }
81
82   /**
83    * Make all neighbors bidirectional.
84    *
85    * @return true, if successful
86    */
87   public boolean makeAllNeighborsBidirectional() {
88     return makeAllNeighborsBidirectional;
89   }
90
91   public void setMakeAllNeighborsBidirectional(boolean makeAllNeighborsBidirectional) {
92     this.makeAllNeighborsBidirectional = makeAllNeighborsBidirectional;
93   }
94
95   public String getSelectedSearchedNodeClassName() {
96     return selectedSearchedNodeClassName;
97   }
98
99   public void setSelectedSearchedNodeClassName(String selectedSearchedNodeClassName) {
100     this.selectedSearchedNodeClassName = selectedSearchedNodeClassName;
101   }
102
103   public String getGeneralNodeClassName() {
104     return generalNodeClassName;
105   }
106
107   public void setGeneralNodeClassName(String generalNodeClassName) {
108     this.generalNodeClassName = generalNodeClassName;
109   }
110
111   public String getSearchNodeClassName() {
112     return searchNodeClassName;
113   }
114
115   public void setSearchNodeClassName(String searchNodeClassName) {
116     this.searchNodeClassName = searchNodeClassName;
117   }
118
119   public String getAaiEntityNodeDescriptors() {
120     return aaiEntityNodeDescriptors;
121   }
122
123   public void setAaiEntityNodeDescriptors(String aaiEntityNodeDescriptors) {
124     this.aaiEntityNodeDescriptors = aaiEntityNodeDescriptors;
125   }
126
127   public boolean isVisualizationDebugEnabled() {
128     return visualizationDebugEnabled;
129   }
130
131   public void setVisualizationDebugEnabled(boolean visualizationDebugEnabled) {
132     this.visualizationDebugEnabled = visualizationDebugEnabled;
133   }
134
135   public void setMaxSelfLinkTraversalDepth(int maxSelfLinkTraversalDepth) {
136     this.maxSelfLinkTraversalDepth = maxSelfLinkTraversalDepth;
137   }
138
139   public int getMaxSelfLinkTraversalDepth() {
140     return maxSelfLinkTraversalDepth;
141   }
142
143   public int getNumOfThreadsToFetchNodeIntegrity() {
144     return numOfThreadsToFetchNodeIntegrity;
145   }
146
147   public void setNumOfThreadsToFetchNodeIntegrity(int numOfThreadsToFetchNodeIntegrity) {
148     this.numOfThreadsToFetchNodeIntegrity = numOfThreadsToFetchNodeIntegrity;
149   }
150
151   public SparkyResourceLoader getResourceLoader() {
152     return resourceLoader;
153   }
154
155   public void setResourceLoader(SparkyResourceLoader resourceLoader) {
156     this.resourceLoader = resourceLoader;
157   }
158
159   @Override
160   public String toString() {
161     return "VisualizationConfigs [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth
162         + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", "
163         + (aaiEntityNodeDescriptors != null
164             ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", " : "")
165         + (generalNodeClassName != null ? "generalNodeClassName=" + generalNodeClassName + ", "
166             : "")
167         + (searchNodeClassName != null ? "searchNodeClassName=" + searchNodeClassName + ", " : "")
168         + (selectedSearchedNodeClassName != null
169             ? "selectedSearchedNodeClassName=" + selectedSearchedNodeClassName + ", " : "")
170         + "numOfThreadsToFetchNodeIntegrity=" + numOfThreadsToFetchNodeIntegrity
171         + ", makeAllNeighborsBidirectional=" + makeAllNeighborsBidirectional + ", "
172         + (shallowEntities != null ? "shallowEntities=" + shallowEntities + ", " : "")
173         + (resourceLoader != null ? "resourceLoader=" + resourceLoader : "") + "]";
174   }
175
176  
177
178 }