summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common')
-rw-r--r--ecomp-portal-BE-common/pom.xml43
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java5
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java15
-rw-r--r--ecomp-portal-BE-common/src/main/webapp/static/fusion/images/onap-portal-logo.pngbin0 -> 71199 bytes
5 files changed, 19 insertions, 45 deletions
diff --git a/ecomp-portal-BE-common/pom.xml b/ecomp-portal-BE-common/pom.xml
index 7f8da046..f5f925b8 100644
--- a/ecomp-portal-BE-common/pom.xml
+++ b/ecomp-portal-BE-common/pom.xml
@@ -125,49 +125,6 @@
</configuration>
</plugin>
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>1.10</version>
- <configuration>
- <encoding>UTF-8</encoding>
- <licenseName>my_license</licenseName>
- <licenseResolver>${project.baseUri}/license</licenseResolver>
- <inceptionYear>2017</inceptionYear>
- <organizationName>AT&amp;T Intellectual Property</organizationName>
- <projectName>ECOMP Portal</projectName>
- <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
- <processStartTag>================================================================================</processStartTag>
- <sectionDelimiter>================================================================================</sectionDelimiter>
- <processEndTag>================================================================================</processEndTag>
- <roots>
- <root>src/main</root>
- <root>src/test</root>
- </roots>
- <excludes>
- <exclude>*.png</exclude>
- <exclude>*.drl</exclude>
- <exclude>*.gif</exclude>
- <exclude>*.jpeg</exclude>
- <exclude>*.jpg</exclude>
- <exclude>*.bmp</exclude>
- <exclude>*.ico</exclude>
- <exclude>*.svg</exclude>
- </excludes>
- </configuration>
- <executions>
- <execution>
- <id>first</id>
- <goals>
- <goal>update-file-header</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
- -->
-
</plugins>
<testResources>
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java
index 175a1c71..0cfa4f81 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java
@@ -21,6 +21,7 @@ package org.openecomp.portalapp.portal.service;
import java.util.List;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.springframework.stereotype.Component;
@@ -44,7 +45,7 @@ public class ConsulHealthServiceImpl implements ConsulHealthService {
HealthClient healthClient = consul.healthClient();
nodes = healthClient.getHealthyServiceInstances(service).getResponse();
} catch (Exception e) {
- String localFallbackServiceLocation = "localhost:" + fallbackPortOnLocalHost;
+ String localFallbackServiceLocation = EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
logger.debug(EELFLoggerDelegate.debugLogger,
" problem getting nodes for service {1}. Defaulting to {2}. Exception: {3}", service,
localFallbackServiceLocation, e.getMessage());
@@ -57,7 +58,7 @@ public class ConsulHealthServiceImpl implements ConsulHealthService {
if (nodes == null || nodes.size() == 0) {
logger.debug(EELFLoggerDelegate.debugLogger, "No healthy node found in the consul cluster running service " + service
+ ". Defaulting to localhost");
- return "localhost:" + fallbackPortOnLocalHost;
+ return EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
} else {
String locationFromConsul;
ServiceHealth node = nodes.get(0);
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java
index 23bb3567..dd33bf6e 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java
@@ -62,5 +62,6 @@ public class EPCommonSystemProperties extends SystemProperties {
public static final String AUTH_USER_SERVER = "auth_user_server";
public static final String EXTERNAL_ACCESS_ENABLE = "external_access_enable";
public static final String WIDGET_MS_PROTOCOL = "microservices.widget.protocol";
+ public static final String WIDGET_MS_HOSTNAME = "microservices.widget.hostname";
} \ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java
index 2b39da0a..d471d90b 100644
--- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java
+++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java
@@ -354,5 +354,20 @@ public class EcompPortalUtils {
return "https";
}
}
+
+ public static String localOrDockerHost(){
+ final String effectiveHost;
+ try{
+ effectiveHost = SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_HOSTNAME);
+ return (effectiveHost == null || effectiveHost.trim().equals("")) ? "localhost" : effectiveHost ;
+ }
+ catch(IllegalStateException ese){
+ //looks like SystemProperties.getProperty throws IllegalStateException if it cannot find a property you are looking for
+ //In order to not break the code if a non-required property is missing from system.properties, returning https as default
+ //when this exception is caught.
+ return "localhost";
+ }
+ }
+
}
diff --git a/ecomp-portal-BE-common/src/main/webapp/static/fusion/images/onap-portal-logo.png b/ecomp-portal-BE-common/src/main/webapp/static/fusion/images/onap-portal-logo.png
new file mode 100644
index 00000000..f48d3d47
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/webapp/static/fusion/images/onap-portal-logo.png
Binary files differ