X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Futils%2FEcompPortalUtils.java;h=e5543a36cbb3e5f0ef234a194fdc1e8ad2a5dd57;hb=25b97739e0a702b18321fda93add927909152e5e;hp=30eeac04baa9d0b705917e324ccc4a4499a79d11;hpb=2a462c99939b19f972813b64c7a4d6e33b9aaa5a;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java index 30eeac04..e5543a36 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java @@ -81,7 +81,8 @@ public class EcompPortalUtils { // It is a regular expression used for while creating a External Central Auth // Role - public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:])"; + public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:^-])"; + public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS_EXCLUDE_HYPHEN = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:])"; public static final String slash = "/"; @@ -376,6 +377,15 @@ public class EcompPortalUtils { public static String widgetMsProtocol() { return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_PROTOCOL, "https"); } + + /** + * Answers the protocol to use. + * + * @return Protocol name from property file; defaults to https. + */ + public static String widgetMLProtocol() { + return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_ML_PROTOCOL, "https"); + } /** * Answers the host to use. @@ -385,6 +395,15 @@ public class EcompPortalUtils { public static String localOrDockerHost() { return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_HOSTNAME, "localhost"); } + + /** + * Answers the host to use. + * + * @return Host name from property file; defaults to localhost. + */ + public static String mlLocalOrDockerHost() { + return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_ML_HOSTNAME, "localhost"); + } /** * It returns headers where username and password of external central auth is