From ac05129bf7c8fbe62f17647f6233ce01a58ca1a3 Mon Sep 17 00:00:00 2001 From: st782s Date: Thu, 27 Jul 2017 09:57:46 -0400 Subject: Role centralization Adding functionality to account for global roles across all applications which will be added at portal level Issue: [PORTAL-21] Change-Id: I4cdee652aaaa124abddb63410e1e45257b5bb6e0 Signed-off-by: st782s --- .../core/onboarding/rest/RestWebServiceClient.java | 26 ++++++++++++++++++++-- .../core/onboarding/util/PortalApiConstants.java | 2 ++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding') diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/rest/RestWebServiceClient.java b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/rest/RestWebServiceClient.java index 1d4feb07..fa7a1478 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/rest/RestWebServiceClient.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/rest/RestWebServiceClient.java @@ -183,8 +183,16 @@ public class RestWebServiceClient { // Create the connection object HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); + con.setConnectTimeout(3000); + // if the portal property is set then gets the timeout value from portal properties + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){ + con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT))); + } con.setReadTimeout(8000); + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){ + con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT))); + } // add request header con.setRequestProperty("uebkey", appUebKey); @@ -325,9 +333,17 @@ public class RestWebServiceClient { // Create the connection object HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); + con.setConnectTimeout(3000); + // if the portal property is set then gets the timeout value from portal properties + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){ + con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT))); + } con.setReadTimeout(15000); - + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){ + con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT))); + } + // add request header con.setRequestProperty("uebkey", appUebKey); if (appUserName != null) @@ -414,8 +430,14 @@ public class RestWebServiceClient { HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); con.setConnectTimeout(3000); + // if the portal property is set then gets the timeout value from portal properties + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT)!= null){ + con.setConnectTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_CONNECTION_TIMEOUT))); + } con.setReadTimeout(15000); - + if(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT)!= null){ + con.setReadTimeout(Integer.parseInt(PortalApiProperties.getProperty(PortalApiConstants.EXT_REQUEST_READ_TIMEOUT))); + } // add request header con.setRequestProperty("uebkey", appUebKey); if (appUserName != null) diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/util/PortalApiConstants.java b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/util/PortalApiConstants.java index 196d2100..7f42a1d5 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/util/PortalApiConstants.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/util/PortalApiConstants.java @@ -63,4 +63,6 @@ public interface PortalApiConstants { //encrpt key public static final String Decryption_Key = "decryption_key"; + public static final String EXT_REQUEST_CONNECTION_TIMEOUT = "ext_req_connection_timeout"; + public static final String EXT_REQUEST_READ_TIMEOUT = "ext_req_read_timeout"; } -- cgit 1.2.3-korg