diff options
Diffstat (limited to 'common-app-api/src/main/java')
3 files changed, 97 insertions, 0 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/api/Constants.java b/common-app-api/src/main/java/org/openecomp/sdc/common/api/Constants.java index 8e15b96e0c..839dc0bdd2 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/api/Constants.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/api/Constants.java @@ -140,4 +140,7 @@ public interface Constants { //external HealthCheck components public static final String HC_COMPONENT_ON_BOARDING = "ON_BOARDING"; public static final String HC_COMPONENT_DCAE = "DCAE"; + + //Designer BL + public static final String DESIGNER_BL_COMPONENT = "designerStatusBL"; } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/fe/config/ConfigurationManager.java b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/ConfigurationManager.java index b3164fd283..0e1aabcccf 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/fe/config/ConfigurationManager.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/ConfigurationManager.java @@ -30,11 +30,14 @@ import org.openecomp.sdc.common.api.FileChangeCallback; import org.openecomp.sdc.common.config.EcompErrorConfiguration; import org.openecomp.sdc.common.config.IEcompConfigurationManager; import org.openecomp.sdc.common.rest.api.RestConfigurationInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ConfigurationManager implements FileChangeCallback, IEcompConfigurationManager { ConfigurationSource configurationSource = null; private static ConfigurationManager instance; + private static Logger log = LoggerFactory.getLogger(ConfigurationManager.class.getName()); public ConfigurationManager(ConfigurationSource configurationSource) { super(); @@ -50,11 +53,14 @@ public class ConfigurationManager implements FileChangeCallback, IEcompConfigura loadConfigurationClass(Configuration.class); loadConfigurationClass(RestConfigurationInfo.class); loadConfigurationClass(EcompErrorConfiguration.class); + loadConfigurationClass(DesignersConfiguration.class); } private <T extends BasicConfiguration> void loadConfigurationClass(Class<T> clazz) { ConfigurationListener configurationListener = new ConfigurationListener(clazz, this); + + log.info("created listener for class {}: {}", clazz.getName(), configurationListener); T object = configurationSource.getAndWatchConfiguration(clazz, configurationListener); @@ -85,6 +91,13 @@ public class ConfigurationManager implements FileChangeCallback, IEcompConfigura return (EcompErrorConfiguration) configurations.get(getKey(EcompErrorConfiguration.class)); } + + public DesignersConfiguration getDesignersConfiguration() { + + log.info("requested designers configuration and got this:{}", (DesignersConfiguration) configurations.get(getKey(DesignersConfiguration.class))); + + return (DesignersConfiguration) configurations.get(getKey(DesignersConfiguration.class)); + } public Configuration getConfigurationAndWatch(ConfigurationListener configurationListener) { @@ -114,4 +127,8 @@ public class ConfigurationManager implements FileChangeCallback, IEcompConfigura public static ConfigurationManager getConfigurationManager() { return instance; } + + public static void setTestInstance(ConfigurationManager configurationManagerInstance) { + instance = configurationManagerInstance; + } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/fe/config/DesignersConfiguration.java b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/DesignersConfiguration.java new file mode 100644 index 0000000000..1b89ba02fd --- /dev/null +++ b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/DesignersConfiguration.java @@ -0,0 +1,77 @@ +package org.openecomp.sdc.fe.config; + +import java.util.HashMap; +import java.util.Map; + +import org.openecomp.sdc.common.api.BasicConfiguration; + +public class DesignersConfiguration extends BasicConfiguration { + + private Map<String,Designer> designersList; + + public Map<String,Designer> getDesignersList() { + return designersList; + } + + public void setDesignersList(Map<String,Designer> designersList) { + this.designersList = designersList; + } + + public DesignersConfiguration() { + this.designersList = new HashMap<String, Designer>(); + } + + public static class Designer { + + private String displayName; + private String designerHost; + private Integer designerPort; + private String designerPath; + private String designerProtocol; + + + public String getDesignerProtocol() { + return designerProtocol; + } + + public void setDesignerProtocol(String designerProtocol) { + this.designerProtocol = designerProtocol; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getDesignerHost() { + return designerHost; + } + + public void setDesignerHost(String designerHost) { + this.designerHost = designerHost; + } + + public Integer getDesignerPort() { + return designerPort; + } + + public void setDesignerPort(Integer designerPort) { + this.designerPort = designerPort; + } + + public String getDesignerPath() { + return designerPath; + } + + public void setDesignerPath(String designerPath) { + this.designerPath = designerPath; + } + + } + +} + + |