- private HttpURLConnection getSdcHttpUrlConnection(String userid, int postDataLength, String url, String md5Text)\r
- throws IOException {\r
- logger.info("userid=" + userid);\r
- String basicAuth = SdcReq.getSdcBasicAuth(refProp);\r
- String sdcXonapInstanceId = refProp.getStringValue("sdc.sdcX-InstanceID");\r
- URL urlObj = new URL(url);\r
- HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
- conn.setDoOutput(true);\r
- conn.setRequestProperty(refProp.getStringValue("sdc.InstanceID"), sdcXonapInstanceId);\r
- conn.setRequestProperty("Authorization", basicAuth);\r
- conn.setRequestProperty("Content-Type", "application/json");\r
- conn.setRequestProperty("Content-MD5", md5Text);\r
- conn.setRequestProperty("USER_ID", userid);\r
- conn.setRequestMethod("POST");\r
- conn.setRequestProperty("charset", "utf-8");\r
- conn.setRequestProperty("Content-Length", Integer.toString(postDataLength));\r
- conn.setUseCaches(false);\r
- conn.setRequestProperty("X-ECOMP-RequestID", LoggingUtils.getRequestId());\r
- return conn;\r
+ private HttpURLConnection getSdcHttpUrlConnection(String userid, int postDataLength, String url, String md5Text) {\r
+ try {\r
+ logger.info("userid=" + userid);\r
+ String basicAuth = SdcReq.getSdcBasicAuth(refProp);\r
+ String sdcXonapInstanceId = refProp.getStringValue("sdc.sdcX-InstanceID");\r
+ URL urlObj = new URL(url);\r
+ HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
+ conn.setDoOutput(true);\r
+ conn.setRequestProperty(refProp.getStringValue("sdc.InstanceID"), sdcXonapInstanceId);\r
+ conn.setRequestProperty("Authorization", basicAuth);\r
+ conn.setRequestProperty("Content-Type", "application/json");\r
+ conn.setRequestProperty("Content-MD5", md5Text);\r
+ conn.setRequestProperty("USER_ID", userid);\r
+ conn.setRequestMethod("POST");\r
+ conn.setRequestProperty("charset", "utf-8");\r
+ conn.setRequestProperty("Content-Length", Integer.toString(postDataLength));\r
+ conn.setUseCaches(false);\r
+ conn.setRequestProperty("X-ECOMP-RequestID", LoggingUtils.getRequestId());\r
+ return conn;\r
+ } catch (IOException e) {\r
+ logger.error("Exception when attempting to open connection with SDC", e);\r
+ throw new SdcCommunicationException("Exception when attempting to open connection with SDC", e);\r
+ }\r