slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 1 | /* |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.xran; |
| 18 | |
| 19 | import com.fasterxml.jackson.databind.JsonNode; |
| 20 | import com.fasterxml.jackson.databind.node.ObjectNode; |
| 21 | import org.onosproject.store.Store; |
| 22 | import org.onosproject.xran.codecs.api.ECGI; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 23 | import org.onosproject.xran.controller.XranController; |
| 24 | import org.onosproject.xran.entities.RnibCell; |
| 25 | import org.onosproject.xran.entities.RnibLink; |
| 26 | import org.onosproject.xran.entities.RnibSlice; |
| 27 | import org.onosproject.xran.entities.RnibUe; |
| 28 | import org.onosproject.xran.identifiers.LinkId; |
| 29 | |
| 30 | import java.util.List; |
| 31 | |
| 32 | /** |
| 33 | * Created by dimitris on 7/22/17. |
| 34 | */ |
| 35 | public interface XranStore extends Store { |
| 36 | |
| 37 | // LINKS STORE |
| 38 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 39 | /** |
| 40 | * Get all active links. |
| 41 | * |
| 42 | * @return list of links |
| 43 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 44 | List<RnibLink> getLinks(); |
| 45 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 46 | /** |
| 47 | * Get all links for that CELL based on ECGI. |
| 48 | * |
| 49 | * @param ecgi CELL ECGI |
| 50 | * @return list of links |
| 51 | */ |
| 52 | List<RnibLink> getlinksbyecgi(ECGI ecgi); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 53 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 54 | /** |
| 55 | * Get all links for that CELL based on ECI. |
| 56 | * |
| 57 | * @param eciHex HEX string of ECI |
| 58 | * @return list of links |
| 59 | */ |
| 60 | List<RnibLink> getlinksbycellid(String eciHex); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 61 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 62 | /** |
| 63 | * Get all links for the UE based on UE ID. |
| 64 | * |
| 65 | * @param ueId UE ID |
| 66 | * @return list of links |
| 67 | */ |
| 68 | List<RnibLink> getlinksbyueid(long ueId); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 69 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 70 | /** |
| 71 | * Get a link between a CELL and UE. |
| 72 | * |
| 73 | * @param cellId HEX string ECI |
| 74 | * @param ueId UE id |
| 75 | * @return link |
| 76 | */ |
| 77 | RnibLink getlinkbetweencellidueid(String cellId, long ueId); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 78 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 79 | /** |
| 80 | * Get a link between a CELL's ECGI and UE's id. |
| 81 | * |
| 82 | * @param ecgi CELL ECGI |
| 83 | * @param ueId UE id |
| 84 | * @return link |
| 85 | */ |
slowr | c86750e | 2017-08-22 17:26:47 -0700 | [diff] [blame] | 86 | RnibLink getLink(ECGI ecgi, Long ueId); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 87 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 88 | /** |
| 89 | * Modify specified link's RRM Configuration. |
| 90 | * |
| 91 | * @param link LINK entity |
| 92 | * @param rrmConf json node of RRM Configuration |
| 93 | */ |
| 94 | void modifylinkrrmconf(RnibLink link, JsonNode rrmConf); |
slowr | 8ddc2b1 | 2017-08-14 14:13:38 -0700 | [diff] [blame] | 95 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 96 | /** |
| 97 | * Put new link to store. |
| 98 | * |
| 99 | * @param link LINK entity |
| 100 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 101 | void storeLink(RnibLink link); |
| 102 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 103 | /** |
| 104 | * Remove link from store. |
| 105 | * |
| 106 | * @param link LINK entity |
| 107 | * @return true if remove succeeded |
| 108 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 109 | boolean removeLink(LinkId link); |
| 110 | |
| 111 | // NODES |
| 112 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 113 | /** |
| 114 | * Get all CELLs and UEs. |
| 115 | * |
| 116 | * @return list of UEs and CELLs |
| 117 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 118 | List<Object> getNodes(); |
| 119 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 120 | /** |
| 121 | * Get all CELLs. |
| 122 | * |
| 123 | * @return list of CELLs |
| 124 | */ |
| 125 | List<Object> getcellnodes(); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 126 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 127 | /** |
| 128 | * Get all UEs. |
| 129 | * |
| 130 | * @return list of UEs |
| 131 | */ |
| 132 | List<Object> getuenodes(); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 133 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 134 | /** |
| 135 | * Get node by node id. |
| 136 | * |
| 137 | * @param nodeId HEX string ECI or UE id |
| 138 | * @return CELL or UE |
| 139 | */ |
| 140 | Object getbynodeid(String nodeId); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 141 | |
| 142 | // CELL |
| 143 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 144 | /** |
| 145 | * Get cell based on HEX string ECI. |
| 146 | * |
| 147 | * @param eci HEX string ECI |
| 148 | * @return CELL if found |
| 149 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 150 | RnibCell getCell(String eci); |
| 151 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 152 | /** |
| 153 | * Get cell based on ECGI. |
| 154 | * |
| 155 | * @param cellId CELL ECGI |
| 156 | * @return CELL if found |
| 157 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 158 | RnibCell getCell(ECGI cellId); |
| 159 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 160 | /** |
| 161 | * Modify CELL's RRM Configuration. |
| 162 | * |
| 163 | * @param cell CELL entity |
| 164 | * @param rrmConf json node of RRM Configuration |
| 165 | * @throws Exception exception |
| 166 | */ |
| 167 | void modifycellrrmconf(RnibCell cell, JsonNode rrmConf) throws Exception; |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 168 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 169 | /** |
| 170 | * Put new CELL to the store. |
| 171 | * |
| 172 | * @param cell CELL entity |
| 173 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 174 | void storeCell(RnibCell cell); |
| 175 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 176 | /** |
| 177 | * Remove CELL from the store. |
| 178 | * |
| 179 | * @param ecgi CELL's ECGI |
| 180 | * @return ture if remove succeeded |
| 181 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 182 | boolean removeCell(ECGI ecgi); |
| 183 | |
| 184 | // SLICE |
| 185 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 186 | /** |
| 187 | * Get SLICE based on SLICE id. |
| 188 | * |
| 189 | * @param sliceId SLICE id |
| 190 | * @return SLICE |
| 191 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 192 | RnibSlice getSlice(long sliceId); |
| 193 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 194 | /** |
| 195 | * Put new SLICE to the store. |
| 196 | * |
| 197 | * @param attributes json node of SLICE attributes |
| 198 | * @return true if put succeeded |
| 199 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 200 | boolean createSlice(ObjectNode attributes); |
| 201 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 202 | /** |
| 203 | * Remove SLICE based on SLICE id. |
| 204 | * |
| 205 | * @param sliceId SLICE id |
| 206 | * @return true if remove succeeded |
| 207 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 208 | boolean removeCell(long sliceId); |
| 209 | |
| 210 | // CONTROLLER |
| 211 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 212 | /** |
| 213 | * Get the xran controller instance. |
| 214 | * |
| 215 | * @return xran controller |
| 216 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 217 | XranController getController(); |
| 218 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 219 | /** |
| 220 | * Set the xran controller instance. |
| 221 | * |
| 222 | * @param controller xran controller |
| 223 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 224 | void setController(XranController controller); |
| 225 | |
| 226 | // UE |
| 227 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 228 | /** |
| 229 | * Get UE based on UE id. |
| 230 | * |
| 231 | * @param euId UE id |
| 232 | * @return UE entity |
| 233 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 234 | RnibUe getUe(long euId); |
| 235 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 236 | /** |
| 237 | * Put new UE to store. |
| 238 | * |
| 239 | * @param ue UE entity |
| 240 | */ |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 241 | void storeUe(RnibUe ue); |
| 242 | |
slowr | 577f322 | 2017-08-28 10:49:08 -0700 | [diff] [blame] | 243 | /** |
| 244 | * Remove UE from store. |
| 245 | * |
| 246 | * @param ueId UE id |
| 247 | * @return true if remove succeeded |
| 248 | */ |
slowr | c86750e | 2017-08-22 17:26:47 -0700 | [diff] [blame] | 249 | boolean removeUe(long ueId); |
slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame] | 250 | } |