2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.openecomp.sparky.viewandinspect.config;
28 import java.util.Properties;
30 import org.openecomp.sparky.util.ConfigHelper;
33 * The Class VisualizationConfig.
35 public class VisualizationConfig {
37 private int maxSelfLinkTraversalDepth;
39 private boolean visualizationDebugEnabled;
41 private String aaiEntityNodeDescriptors;
43 private String generalNodeClassName;
45 private String searchNodeClassName;
47 private String selectedSearchedNodeClassName;
49 private String entityTypesToSummarize;
50 private String vnfEntityTypes;
52 private boolean makeAllNeighborsBidirectional;
54 private static VisualizationConfig instance;
56 public static VisualizationConfig getConfig() {
58 if (instance == null) {
59 instance = new VisualizationConfig();
67 * Instantiates a new visualization config.
69 public VisualizationConfig() {
71 Properties visualizationProps =
72 ConfigHelper.loadConfigFromExplicitPath(TierSupportUiConstants.STATIC_CONFIG_APP_LOCATION
73 + TierSupportUiConstants.FILESEP + "visualization.properties");
75 maxSelfLinkTraversalDepth =
76 Integer.parseInt(visualizationProps.getProperty("maxSelfLinkTraversalDepth", "2"));
77 visualizationDebugEnabled =
78 Boolean.parseBoolean(visualizationProps.getProperty("visualizationDebugEnabled", "false"));
79 aaiEntityNodeDescriptors = visualizationProps.getProperty("aaiEntityNodeDescriptors", null);
80 generalNodeClassName =
81 visualizationProps.getProperty("generalNodeClassName", "unknownClassName");
83 visualizationProps.getProperty("searchedNodeClassName", "unknownClassName");
84 selectedSearchedNodeClassName =
85 visualizationProps.getProperty("selectedSearchedNodeClassName", "unknownClassName");
87 entityTypesToSummarize = visualizationProps.getProperty("entityTypesToSummarize",
88 "customer,service-instance,complex,pserver,vserver,vnf");
90 vnfEntityTypes = visualizationProps.getProperty("vnfEntityTypes", "generic-vnf,newvce,vce,vpe");
92 makeAllNeighborsBidirectional = Boolean
93 .parseBoolean(visualizationProps.getProperty("makeAllNeighborsBidirectional", "false"));
100 * Make all neighbors bidirectional.
102 * @return true, if successful
104 public boolean makeAllNeighborsBidirectional() {
105 return makeAllNeighborsBidirectional;
108 public void setMakeAllNeighborsBidirectional(boolean makeAllNeighborsBidirectional) {
109 this.makeAllNeighborsBidirectional = makeAllNeighborsBidirectional;
112 public String getSelectedSearchedNodeClassName() {
113 return selectedSearchedNodeClassName;
116 public void setSelectedSearchedNodeClassName(String selectedSearchedNodeClassName) {
117 this.selectedSearchedNodeClassName = selectedSearchedNodeClassName;
120 public String getGeneralNodeClassName() {
121 return generalNodeClassName;
124 public void setGeneralNodeClassName(String generalNodeClassName) {
125 this.generalNodeClassName = generalNodeClassName;
128 public String getSearchNodeClassName() {
129 return searchNodeClassName;
132 public void setSearchNodeClassName(String searchNodeClassName) {
133 this.searchNodeClassName = searchNodeClassName;
136 public String getAaiEntityNodeDescriptors() {
137 return aaiEntityNodeDescriptors;
140 public void setAaiEntityNodeDescriptors(String aaiEntityNodeDescriptors) {
141 this.aaiEntityNodeDescriptors = aaiEntityNodeDescriptors;
144 public boolean isVisualizationDebugEnabled() {
145 return visualizationDebugEnabled;
148 public void setVisualizationDebugEnabled(boolean visualizationDebugEnabled) {
149 this.visualizationDebugEnabled = visualizationDebugEnabled;
152 public void setMaxSelfLinkTraversalDepth(int maxSelfLinkTraversalDepth) {
153 this.maxSelfLinkTraversalDepth = maxSelfLinkTraversalDepth;
156 public int getMaxSelfLinkTraversalDepth() {
157 return maxSelfLinkTraversalDepth;
160 public String getEntityTypesToSummarize() {
161 return entityTypesToSummarize;
164 public void setEntityTypesToSummarize(String entityTypesToSummarize) {
165 this.entityTypesToSummarize = entityTypesToSummarize;
168 public String getVnfEntityTypes() {
169 return vnfEntityTypes;
172 public void setVnfEntityTypes(String vnfEntityTypes) {
173 this.vnfEntityTypes = vnfEntityTypes;
177 public String toString() {
178 return "VisualizationConfig [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth
179 + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", "
180 + (aaiEntityNodeDescriptors != null
181 ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", " : "")
182 + (generalNodeClassName != null ? "generalNodeClassName=" + generalNodeClassName + ", "
184 + (searchNodeClassName != null ? "searchNodeClassName=" + searchNodeClassName + ", " : "")
185 + (selectedSearchedNodeClassName != null
186 ? "selectedSearchedNodeClassName=" + selectedSearchedNodeClassName + ", " : "")
187 + (entityTypesToSummarize != null
188 ? "entityTypesToSummarize=" + entityTypesToSummarize + ", " : "")
189 + (vnfEntityTypes != null ? "vnfEntityTypes=" + vnfEntityTypes + ", " : "")
190 + "makeAllNeighborsBidirectional=" + makeAllNeighborsBidirectional + "]";
194 * @see java.lang.Object#toString()