+ private String queryDCAEInventory (String fullUrl) throws IOException, InterruptedException {\r
+ int retryInterval = 0;\r
+ int retryLimit = 1;\r
+ if (refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT) != null) {\r
+ retryLimit = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_LIMIT));\r
+ }\r
+ if (refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL) != null) {\r
+ retryInterval = Integer.valueOf(refProp.getStringValue(DCAE_INVENTORY_RETRY_INTERVAL));\r
+ }\r
+\r
+ int i = 0;\r
+ while (i < retryLimit) {\r
+ i++;\r
+ try {\r
+ return DcaeHttpConnectionManager.doDcaeHttpQuery(fullUrl, "GET", null, null);\r
+ } catch (BadRequestException e) {\r
+ if (i == retryLimit) {\r
+ // reach the retry limit, but still failed to connect to DCAE\r
+ throw e;\r
+ } else {\r
+ // wait for a while and try to connect to DCAE again\r
+ Thread.sleep(retryInterval);\r
+ }\r
+ }\r
+ }\r
+ // normally it should not go to this branch. It should either return the DCAE query result, or throw exception\r
+ return null;\r
+ }\r