aboutsummaryrefslogtreecommitdiffstats
path: root/UniversalVesAdapter/src
diff options
context:
space:
mode:
authoramshegokar <AS00500801@techmahindra.com>2018-09-11 20:20:27 +0530
committeramshegokar <AS00500801@techmahindra.com>2018-09-11 20:20:27 +0530
commitf67bc2db9676c54192a019852594a29f33816534 (patch)
tree2d69c0e8997c691d774ae9b97a3460b0cc29392e /UniversalVesAdapter/src
parent1b2bb4255e73f7b2f98035724aa243b825b8162d (diff)
Security vulnerabilities identified in CLM scan
Mapper: security vulnerabilities identified in CLM scan Change-Id: I2b977e99e4ad6d1aae24e0d441da6002c28ab0ac Issue-ID: DCAEGEN2-769 Signed-off-by: amshegokar <AS00500801@techmahindra.com>
Diffstat (limited to 'UniversalVesAdapter/src')
-rw-r--r--UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java35
-rw-r--r--UniversalVesAdapter/src/main/resources/application.properties12
2 files changed, 38 insertions, 9 deletions
diff --git a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java
index f92511e..ca1bcc9 100644
--- a/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java
+++ b/UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java
@@ -79,11 +79,40 @@ public class VESAdapterInitializer implements CommandLineRunner, Ordered {
} else {
-
-
LOGGER.info(">>>Static configuration to be used");
-
+ final String url = "http://localhost:8085/start";
+ final String USER_AGENT = "Mozilla/5.0";
+
+ try {
+ URL obj = new URL(url);
+ HttpURLConnection httpURLConnection = (HttpURLConnection) obj.openConnection();
+
+ // optional default is GET
+ httpURLConnection.setRequestMethod("GET");
+
+ // add request header
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ int responseCode = httpURLConnection.getResponseCode();
+ LOGGER.info("Sending 'GET' request to URL : " + url);
+ LOGGER.info("Response Code : " + responseCode);
+ BufferedReader in = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
+ String inputLine;
+ StringBuffer response = new StringBuffer();
+
+ while ((inputLine = in.readLine()) != null) {
+ response.append(inputLine);
+ }
+ in.close();
+
+ // print result
+ LOGGER.info("The result is :" + response.toString());
+
+ } catch (Exception e) {
+ LOGGER.error("Error occured due to :" + e.getMessage());
+ e.printStackTrace();
+ }
+
}
}
diff --git a/UniversalVesAdapter/src/main/resources/application.properties b/UniversalVesAdapter/src/main/resources/application.properties
index c2dec51..c940da4 100644
--- a/UniversalVesAdapter/src/main/resources/application.properties
+++ b/UniversalVesAdapter/src/main/resources/application.properties
@@ -8,11 +8,11 @@ mapperConfig.file=../UniversalVesAdapter/src/main/resources/MapperConfig.json
dmaap.mr_props=DMaapMR.properties
#DEV Machine DB Details
-spring.datasource.url=jdbc:postgresql://10.49.16.19:5432/dummy
-spring.datasource.username=postgres
-spring.datasource.password=root
+#spring.datasource.url=jdbc:postgresql://10.49.16.19:5432/dummy
+#spring.datasource.username=postgres
+#spring.datasource.password=root
#Lab Details
-#spring.datasource.url=jdbc:postgresql://10.53.172.129:5432/dummy
-#spring.datasource.username=ngpuser
-#spring.datasource.password=root \ No newline at end of file
+spring.datasource.url=jdbc:postgresql://10.53.172.129:5432/dummy
+spring.datasource.username=ngpuser
+spring.datasource.password=root \ No newline at end of file