diff options
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java')
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java index a390bbe..9a05b88 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/SdnrRestClient.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * son-handler * ================================================================================ - * Copyright (C) 2019-2020 Wipro Limited. + * Copyright (C) 2019-2021 Wipro Limited. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,12 +37,18 @@ import org.slf4j.LoggerFactory; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.ResponseEntity; -public class SdnrRestClient { +/** + * A subclass which contains the methods + * to get required information from the SDNR Client + * + */ + +public class SdnrRestClient extends ConfigInterface { private static final String DATETIMEFORMAT = "yyyy-MM-dd HH:mm:ss"; private static Logger log = LoggerFactory.getLogger(SdnrRestClient.class); - private SdnrRestClient() { + public SdnrRestClient() { } @@ -52,7 +58,8 @@ public class SdnrRestClient { * @throws ConfigDbNotFoundException * when request to configDB fails */ - public static List<CellPciPair> getNbrList(String cellId) throws ConfigDbNotFoundException { + @Override + public List<CellPciPair> getNbrList(String cellId) throws ConfigDbNotFoundException { Configuration configuration = Configuration.getInstance(); String ts = new SimpleDateFormat(DATETIMEFORMAT).format(new Time(System.currentTimeMillis())); String requestUrl = configuration.getConfigDbService() + "/api/sdnc-config-db/v3/getNbrList" + "/" + cellId @@ -79,7 +86,9 @@ public class SdnrRestClient { * @throws ConfigDbNotFoundException * when request to configDB fails */ - public static int getPci(String cellId) throws ConfigDbNotFoundException { + + @Override + public int getPci(String cellId) throws ConfigDbNotFoundException { Configuration configuration = Configuration.getInstance(); String ts = new SimpleDateFormat(DATETIMEFORMAT).format(new Time(System.currentTimeMillis())); String requestUrl = configuration.getConfigDbService() + "/api/sdnc-config-db/v3/getPCI" + "/" + cellId + "/" @@ -95,7 +104,9 @@ public class SdnrRestClient { * @throws ConfigDbNotFoundException * when request to configDB fails */ - public static String getPnfName(String cellId) throws ConfigDbNotFoundException { + + @Override + public String getPnfName(String cellId) throws ConfigDbNotFoundException { Configuration configuration = Configuration.getInstance(); String ts = new SimpleDateFormat(DATETIMEFORMAT).format(new Time(System.currentTimeMillis())); String requestUrl = configuration.getConfigDbService() + "/api/sdnc-config-db/v3/getPnfId" + "/" + cellId + "/" @@ -111,7 +122,9 @@ public class SdnrRestClient { * @throws ConfigDbNotFoundException * when request to configDB fails */ - public static JSONObject getCellData(String cellId) throws ConfigDbNotFoundException { + + @Override + public JSONObject getCellData(String cellId) throws ConfigDbNotFoundException { Configuration configuration = Configuration.getInstance(); String requestUrl = configuration.getConfigDbService() + "/api/sdnc-config-db/v3/getCell" + "/" + cellId; String response = sendRequest(requestUrl); |