2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.openecomp.sparky.viewandinspect.config;
25 import java.util.Properties;
27 import org.openecomp.sparky.util.ConfigHelper;
30 * The Class VisualizationConfig.
32 public class VisualizationConfig {
34 private int maxSelfLinkTraversalDepth;
36 private boolean visualizationDebugEnabled;
38 private String aaiEntityNodeDescriptors;
40 private String generalNodeClassName;
42 private String searchNodeClassName;
44 private String selectedSearchedNodeClassName;
46 private String entityTypesToSummarize;
47 private String vnfEntityTypes;
49 private boolean makeAllNeighborsBidirectional;
51 private static VisualizationConfig instance;
53 public static VisualizationConfig getConfig() {
55 if (instance == null) {
56 instance = new VisualizationConfig();
64 * Instantiates a new visualization config.
66 public VisualizationConfig() {
68 Properties visualizationProps =
69 ConfigHelper.loadConfigFromExplicitPath(TierSupportUiConstants.STATIC_CONFIG_APP_LOCATION
70 + TierSupportUiConstants.FILESEP + "visualization.properties");
72 maxSelfLinkTraversalDepth =
73 Integer.parseInt(visualizationProps.getProperty("maxSelfLinkTraversalDepth", "2"));
74 visualizationDebugEnabled =
75 Boolean.parseBoolean(visualizationProps.getProperty("visualizationDebugEnabled", "false"));
76 aaiEntityNodeDescriptors = visualizationProps.getProperty("aaiEntityNodeDescriptors", null);
77 generalNodeClassName =
78 visualizationProps.getProperty("generalNodeClassName", "unknownClassName");
80 visualizationProps.getProperty("searchedNodeClassName", "unknownClassName");
81 selectedSearchedNodeClassName =
82 visualizationProps.getProperty("selectedSearchedNodeClassName", "unknownClassName");
84 entityTypesToSummarize = visualizationProps.getProperty("entityTypesToSummarize",
85 "customer,service-instance,complex,pserver,vserver,vnf");
87 vnfEntityTypes = visualizationProps.getProperty("vnfEntityTypes", "generic-vnf,newvce,vce,vpe");
89 makeAllNeighborsBidirectional = Boolean
90 .parseBoolean(visualizationProps.getProperty("makeAllNeighborsBidirectional", "false"));
97 * Make all neighbors bidirectional.
99 * @return true, if successful
101 public boolean makeAllNeighborsBidirectional() {
102 return makeAllNeighborsBidirectional;
105 public void setMakeAllNeighborsBidirectional(boolean makeAllNeighborsBidirectional) {
106 this.makeAllNeighborsBidirectional = makeAllNeighborsBidirectional;
109 public String getSelectedSearchedNodeClassName() {
110 return selectedSearchedNodeClassName;
113 public void setSelectedSearchedNodeClassName(String selectedSearchedNodeClassName) {
114 this.selectedSearchedNodeClassName = selectedSearchedNodeClassName;
117 public String getGeneralNodeClassName() {
118 return generalNodeClassName;
121 public void setGeneralNodeClassName(String generalNodeClassName) {
122 this.generalNodeClassName = generalNodeClassName;
125 public String getSearchNodeClassName() {
126 return searchNodeClassName;
129 public void setSearchNodeClassName(String searchNodeClassName) {
130 this.searchNodeClassName = searchNodeClassName;
133 public String getAaiEntityNodeDescriptors() {
134 return aaiEntityNodeDescriptors;
137 public void setAaiEntityNodeDescriptors(String aaiEntityNodeDescriptors) {
138 this.aaiEntityNodeDescriptors = aaiEntityNodeDescriptors;
141 public boolean isVisualizationDebugEnabled() {
142 return visualizationDebugEnabled;
145 public void setVisualizationDebugEnabled(boolean visualizationDebugEnabled) {
146 this.visualizationDebugEnabled = visualizationDebugEnabled;
149 public void setMaxSelfLinkTraversalDepth(int maxSelfLinkTraversalDepth) {
150 this.maxSelfLinkTraversalDepth = maxSelfLinkTraversalDepth;
153 public int getMaxSelfLinkTraversalDepth() {
154 return maxSelfLinkTraversalDepth;
157 public String getEntityTypesToSummarize() {
158 return entityTypesToSummarize;
161 public void setEntityTypesToSummarize(String entityTypesToSummarize) {
162 this.entityTypesToSummarize = entityTypesToSummarize;
165 public String getVnfEntityTypes() {
166 return vnfEntityTypes;
169 public void setVnfEntityTypes(String vnfEntityTypes) {
170 this.vnfEntityTypes = vnfEntityTypes;
174 public String toString() {
175 return "VisualizationConfig [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth
176 + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", "
177 + (aaiEntityNodeDescriptors != null
178 ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", " : "")
179 + (generalNodeClassName != null ? "generalNodeClassName=" + generalNodeClassName + ", "
181 + (searchNodeClassName != null ? "searchNodeClassName=" + searchNodeClassName + ", " : "")
182 + (selectedSearchedNodeClassName != null
183 ? "selectedSearchedNodeClassName=" + selectedSearchedNodeClassName + ", " : "")
184 + (entityTypesToSummarize != null
185 ? "entityTypesToSummarize=" + entityTypesToSummarize + ", " : "")
186 + (vnfEntityTypes != null ? "vnfEntityTypes=" + vnfEntityTypes + ", " : "")
187 + "makeAllNeighborsBidirectional=" + makeAllNeighborsBidirectional + "]";
191 * @see java.lang.Object#toString()