diff options
Diffstat (limited to 'UniversalVesAdapter/src')
-rw-r--r-- | UniversalVesAdapter/src/main/java/org/onap/universalvesadapter/service/VESAdapterInitializer.java | 35 | ||||
-rw-r--r-- | UniversalVesAdapter/src/main/resources/application.properties | 12 |
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 |