summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw
diff options
context:
space:
mode:
authorst782s <statta@research.att.com>2017-07-27 09:57:46 -0400
committerst782s <statta@research.att.com>2017-07-27 12:37:10 -0400
commitac05129bf7c8fbe62f17647f6233ce01a58ca1a3 (patch)
tree305fe715730297eaa9a6d12ba40ee19c00c0bb8c /ecomp-sdk/epsdk-fw
parentcb02f8fc9b1d6233fc75fe37db313abd32edf6cb (diff)
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 <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-fw')
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/rest/RestWebServiceClient.java26
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/util/PortalApiConstants.java2
2 files changed, 26 insertions, 2 deletions
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";
}