The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
-## [2.1.4] - 21/06/2021
+## [2.1.4] - 2021/06/21
- [DCAEGEN2-2711](https://jira.onap.org/browse/DCAEGEN2-2711) - Update sdk version to load policies from a file mounted by policy sidecar container
- [DCAEGEN2-2809](https://jira.onap.org/browse/DCAEGEN2-2809) - Remove security vulnerabilities
- [DCAEGEN2-2884](https://jira.onap.org/browse/DCAEGEN2-2884) - Update FM message spec to VES 7.2
- [DCAEGEN2-2883](https://jira.onap.org/browse/DCAEGEN2-2883) - Implement CPS Client in SON Handler
+ - [DCAEGEN2-2905](https://jira.onap.org/browse/DCAEGEN2-2905) - Refactored code for standardizing configuration retrieval through common method
-## [2.1.3] - 03/02/2021
+## [2.1.3] - 2021/02/03
- [DCAEGEN2-2599](https://jira.onap.org/browse/DCAEGEN2-2599) - Remove security vulnerabilities
import java.util.List;
import java.util.Map;
+import org.onap.dcaegen2.services.sonhms.restclient.ConfigInterface;
+import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Configuration.instance = instance;
}
+ public ConfigInterface getConfigurationClient()
+ {
+ ConfigInterface conf = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType());
+ return conf;
+ }
+
@Override
public String toString() {
return "Configuration [pgHost=" + pgHost + ", pgPort=" + pgPort + ", pgUsername=" + pgUsername + ", pgPassword="
Type mapType = new TypeToken<Map<String, Object>>() {
}.getType();
+
JsonObject subscribes = jsonObject.getAsJsonObject("streams_subscribes");
streamsSubscribes = new Gson().fromJson(subscribes, mapType);
import org.onap.dcaegen2.services.sonhms.model.HoDetails;
import org.onap.dcaegen2.services.sonhms.model.ThreadId;
import org.onap.dcaegen2.services.sonhms.restclient.AsyncResponseBody;
+import org.onap.dcaegen2.services.sonhms.restclient.ConfigInterface;
import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient;
import org.onap.dcaegen2.services.sonhms.restclient.PciSolutions;
import org.onap.dcaegen2.services.sonhms.utils.BeanUtil;
private static final Logger log = org.slf4j.LoggerFactory.getLogger(ChildThread.class);
private static Timestamp startTime;
private static String networkId;
+ Configuration config = Configuration.getInstance();
/**
FixedPciCellsRepository fixedPciCellsRepository = BeanUtil.getBean(FixedPciCellsRepository.class);
List<String> fixedPciCells = fixedPciCellsRepository.getFixedPciCells();
String cellId = fixedPciCells.get(0);
- JSONObject cellData = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getCellData(cellId);
+ JSONObject cellData = config.getConfigurationClient().getCellData(cellId);
networkId = cellData.getJSONObject("Cell").getString("networkId");
}
for (PciSolutions pcisolutions : pciSolutionsList) {
String cellId = pcisolutions.getCellId();
- int oldPci = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPci(cellId);
+ int oldPci = config.getConfigurationClient().getPci(cellId);
int newPci = pcisolutions.getPci();
PciUpdate pciUpdate = new PciUpdate();
pciUpdate.setCellId(cellId);
private PnfUtils pnfUtils;
private PolicyDmaapClient policyDmaapClient;
private HoMetricsComponent hoMetricsComponent;
+ Configuration configuration = Configuration.getInstance();
/**
* Parameterized constructor.
public Boolean triggerOrWait(Map<String, ArrayList<Integer>> collisionConfusionResult) {
// determine collision or confusion
- Configuration configuration = Configuration.getInstance();
int collisionSum = 0;
int confusionSum = 0;
lteCell.setBlacklisted("true");
lteCell.setPlmnId(solutions.getNetworkId());
lteCell.setCid(removeableNeighbor);
- int pci = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPci(cellId);
+ int pci = configuration.getConfigurationClient().getPci(cellId);
lteCell.setPhyCellId(pci);
lteCell.setPnfName(pnfName);
lteCellList.add(lteCell);
public class PnfUtils {
private static final Logger log = org.slf4j.LoggerFactory.getLogger(ChildThreadUtils.class);
+ Configuration config = Configuration.getInstance();
/**
* get pnfs.
if (cellInfo.isPresent()) {
pnfName = cellInfo.get().getPnfName();
} else {
- pnfName = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPnfName(cellId);
+ pnfName = config.getConfigurationClient().getPnfName(cellId);
cellInfoRepository.save(new CellInfo(cellId, pnfName));
}
if (pnfs.containsKey(pnfName)) {
List<String> removeableNeighbors;
for (AnrSolutions anrSolution : anrSolutions) {
String cellId = anrSolution.getCellId();
- String pnfName = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPnfName(cellId);
+ String pnfName = config.getConfigurationClient().getPnfName(cellId);
removeableNeighbors = anrSolution.getRemoveableNeighbors();
Map<String, List<String>> cellRemNeighborsPair = new HashMap<>();
cellRemNeighborsPair.put(cellId, removeableNeighbors);
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.ConfigInterface;
import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient;
import org.onap.dcaegen2.services.sonhms.restclient.CpsClient;
import org.onap.dcaegen2.services.sonhms.restclient.SdnrRestClient;
public class ClusterUtils {
private static Logger log = LoggerFactory.getLogger(ClusterUtils.class);
+ Configuration config = Configuration.getInstance();
public List<ClusterDetails> getAllClusters() {
ClusterDetailsComponent clusterDetailsComponent = new ClusterDetailsComponent();
val1.setPhysicalCellId(phy);
cluster.addEdge(val, val1);
- List<CellPciPair> nbrList = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getNbrList(cell);
+ List<CellPciPair> nbrList = config.getConfigurationClient().getNbrList(cell);
for (CellPciPair nbr : nbrList) {
String cid = nbr.getCellId();
*/
public Map<CellPciPair, ArrayList<CellPciPair>> findClusterMap(String cellId) throws ConfigDbNotFoundException, CpsNotFoundException {
log.info("indide clusterMap");
- int phyCellId = ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getPci(cellId);
+ int phyCellId = config.getConfigurationClient().getPci(cellId);
CellPciPair main = new CellPciPair();
main.setCellId(cellId);
main.setPhysicalCellId(phyCellId);
ArrayList<CellPciPair> cellPciPairs;
- cellPciPairs = (ArrayList<CellPciPair>) ConfigurationClient.configClient(Configuration.getInstance().getConfigClientType()).getNbrList(cellId);
+ cellPciPairs = (ArrayList<CellPciPair>) config.getConfigurationClient().getNbrList(cellId);
Map<CellPciPair, ArrayList<CellPciPair>> clusterMap = new HashMap<>();
clusterMap.put(main, cellPciPairs);
log.info("clusterMap{}", clusterMap);
}
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn(3).when(sdnr, "getPci", Mockito.anyString());
PowerMockito.doReturn("pnfName").when(sdnr, "getPnfName", Mockito.anyString());
when(policyDmaapClient.sendNotificationToPolicy(Mockito.anyString())).thenReturn(true);
.thenReturn(cellInfoNull);
try {
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
+ PowerMockito.when(config.getConfigurationClient())
.thenReturn(sdnr);
PowerMockito.doReturn(pnfName).when(sdnr, "getPnfName", Mockito.anyString());
PowerMockito.when(cellInfoRepositoryMock.save(new CellInfo(cellId, pnfName))).thenReturn(new CellInfo());
try {
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn("ncServer1").when(sdnr, "getPnfName", Mockito.anyString());
actual = pnfUtils.getPnfsForAnrSolutions(anrSolutions);
} catch (ConfigDbNotFoundException e) {
import org.onap.dcaegen2.services.sonhms.model.Notification;
import org.onap.dcaegen2.services.sonhms.Configuration;
import org.onap.dcaegen2.services.sonhms.exceptions.CpsNotFoundException;
+import org.onap.dcaegen2.services.sonhms.restclient.ConfigInterface;
import org.onap.dcaegen2.services.sonhms.restclient.ConfigurationClient;
import org.onap.dcaegen2.services.sonhms.restclient.SdnrRestClient;
import org.powermock.api.mockito.PowerMockito;
Configuration config = Configuration.getInstance();
PowerMockito.whenNew(SdnrRestClient.class).withAnyArguments().thenReturn(sdnr);
- PowerMockito.when(ConfigurationClient.configClient(config.getConfigClientType()))
- .thenReturn(sdnr);
+ PowerMockito.when(config.getConfigurationClient()).thenReturn(sdnr);
PowerMockito.doReturn(nbrList).when(sdnr, "getNbrList", Mockito.anyString());
clusterMap.put(new CellPciPair("45", 310), (ArrayList<CellPciPair>) firstNbrList);