diff options
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java')
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java b/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java index 7228f78..7198fce 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/utils/ClusterUtils.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * son-handler * ================================================================================ - * Copyright (C) 2019 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. @@ -33,16 +33,20 @@ import java.util.Set; import java.util.UUID; import org.onap.dcaegen2.services.sonhms.ClusterDetailsComponent; +import org.onap.dcaegen2.services.sonhms.Configuration; import org.onap.dcaegen2.services.sonhms.FaultNotificationtoClusterMapping; import org.onap.dcaegen2.services.sonhms.NotificationToClusterMapping; import org.onap.dcaegen2.services.sonhms.child.Graph; import org.onap.dcaegen2.services.sonhms.dao.ClusterDetailsRepository; import org.onap.dcaegen2.services.sonhms.entity.ClusterDetails; import org.onap.dcaegen2.services.sonhms.exceptions.ConfigDbNotFoundException; +import org.onap.dcaegen2.services.sonhms.exceptions.CpsNotFoundException; import org.onap.dcaegen2.services.sonhms.model.CellPciPair; import org.onap.dcaegen2.services.sonhms.model.FapServiceList; import org.onap.dcaegen2.services.sonhms.model.LteNeighborListInUseLteCell; import org.onap.dcaegen2.services.sonhms.model.Notification; +import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient; +import org.onap.dcaegen2.services.sonhms.restclient.CpsClient; import org.onap.dcaegen2.services.sonhms.restclient.SdnrRestClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -226,8 +230,8 @@ public class ClusterUtils { /** * Create cluster. */ - public Graph createCluster(Map<CellPciPair, ArrayList<CellPciPair>> clusterMap) throws ConfigDbNotFoundException { - + public Graph createCluster(Map<CellPciPair, ArrayList<CellPciPair>> clusterMap) throws ConfigDbNotFoundException, CpsNotFoundException + { Graph cluster = new Graph(); log.debug("cluster formation started"); @@ -246,7 +250,7 @@ public class ClusterUtils { val1.setPhysicalCellId(phy); cluster.addEdge(val, val1); - List<CellPciPair> nbrList = SdnrRestClient.getNbrList(cell); + List<CellPciPair> nbrList = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getNbrList(cell); for (CellPciPair nbr : nbrList) { String cid = nbr.getCellId(); @@ -297,14 +301,14 @@ public class ClusterUtils { /** * Find cluster Map. */ - public Map<CellPciPair, ArrayList<CellPciPair>> findClusterMap(String cellId) throws ConfigDbNotFoundException { + public Map<CellPciPair, ArrayList<CellPciPair>> findClusterMap(String cellId) throws ConfigDbNotFoundException, CpsNotFoundException { log.info("indide clusterMap"); - int phyCellId = SdnrRestClient.getPci(cellId); + int phyCellId = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPci(cellId); CellPciPair main = new CellPciPair(); main.setCellId(cellId); main.setPhysicalCellId(phyCellId); ArrayList<CellPciPair> cellPciPairs; - cellPciPairs = (ArrayList<CellPciPair>) SdnrRestClient.getNbrList(cellId); + cellPciPairs = (ArrayList<CellPciPair>) ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getNbrList(cellId); Map<CellPciPair, ArrayList<CellPciPair>> clusterMap = new HashMap<>(); clusterMap.put(main, cellPciPairs); log.info("clusterMap{}", clusterMap); |