diff options
Diffstat (limited to 'ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java')
-rw-r--r-- | ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java index 2d49f63..af552e3 100644 --- a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/models/NRCellCU.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Ran Simulator Controller * ================================================================================ - * Copyright (C) 2020-2021 Wipro Limited. + * Copyright (C) 2020-2022 Wipro Limited. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,10 @@ package org.onap.ransim.rest.api.models; import java.io.Serializable; +import org.apache.log4j.Logger; import java.util.List; +import java.util.ArrayList; +import org.onap.ransim.rest.api.controller.RansimController; import javax.persistence.CascadeType; import javax.persistence.CollectionTable; @@ -37,7 +40,7 @@ import javax.persistence.Table; @Entity @Table(name = "NRCELLCU") -public class NRCellCU implements Serializable { +public class NRCellCU implements Serializable, Comparable<NRCellCU> { private static final long serialVersionUID = 1L; @Id @Column(name = "CELLLOCALID") @@ -47,6 +50,9 @@ public class NRCellCU implements Serializable { @ElementCollection(fetch = FetchType.EAGER) @CollectionTable(name = "PLMNINFO", joinColumns = @JoinColumn(name = "nrcellcu_celllocalid")) private List<PLMNInfo> pLMNInfoList; + @Column(name = "NRCELLRELATIONLIST") + @OneToMany(mappedBy = "cellLocalId", cascade = CascadeType.ALL) + private List<NRCellRelation> nrCellRelationsList; @ManyToOne @JoinColumn(name = "gnbcuname") private GNBCUCPFunction gNBCUCPFunction; @@ -58,6 +64,11 @@ public class NRCellCU implements Serializable { public void setCellLocalId(Integer cellLocalId) { this.cellLocalId = cellLocalId; } + public List<NRCellRelation> getNrCellRelationsList() { return nrCellRelationsList; } + + public void setNrCellRelationsList(List<NRCellRelation> nrCellRelationsList) { + this.nrCellRelationsList = nrCellRelationsList; + } public List<PLMNInfo> getpLMNInfoList() { return pLMNInfoList; @@ -83,4 +94,20 @@ public class NRCellCU implements Serializable { this.resourceType = resourceType; } + static Logger log = Logger.getLogger(RansimController.class.getName()); + + public void display() { + + List<NRCellRelation> iterator = new ArrayList<>(nrCellRelationsList); + for (int ii = 0; ii < iterator.size(); ii++) { + log.info("neighbors NeighborList: " + iterator.get(ii).getCellLocalId()+ " " + + iterator.get(ii).getIdNRCellRelation() + " " + iterator.get(ii).getisHOAllowed()); + } + } + + @Override + public int compareTo(NRCellCU cd) { + return this.getCellLocalId().compareTo(cd.getCellLocalId()); + } + } |