blob: 007d9403f4b9ef9069ec7a7773fc45c8a0a651a8 [file] [log] [blame]
Yixiao Chen68bfab22016-11-11 11:04:10 -05001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Yixiao Chen68bfab22016-11-11 11:04:10 -05003 *
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 */
16package org.onosproject.tetopology.management.impl;
17
18import java.util.List;
19import java.util.concurrent.BlockingQueue;
20
21import org.onosproject.store.Store;
22import org.onosproject.tetopology.management.api.KeyId;
23import org.onosproject.tetopology.management.api.Network;
24import org.onosproject.tetopology.management.api.TeTopologies;
25import org.onosproject.tetopology.management.api.TeTopology;
26import org.onosproject.tetopology.management.api.TeTopologyEvent;
27import org.onosproject.tetopology.management.api.TeTopologyKey;
28import org.onosproject.tetopology.management.api.link.NetworkLink;
29import org.onosproject.tetopology.management.api.link.NetworkLinkKey;
30import org.onosproject.tetopology.management.api.link.TeLink;
31import org.onosproject.tetopology.management.api.link.TeLinkTpGlobalKey;
32import org.onosproject.tetopology.management.api.node.NetworkNode;
33import org.onosproject.tetopology.management.api.node.NetworkNodeKey;
34import org.onosproject.tetopology.management.api.node.TeNode;
35import org.onosproject.tetopology.management.api.node.TeNodeKey;
36import org.onosproject.tetopology.management.api.node.TerminationPoint;
37import org.onosproject.tetopology.management.api.node.TerminationPointKey;
38import org.onosproject.tetopology.management.api.node.TtpKey;
39import org.onosproject.tetopology.management.api.node.TunnelTerminationPoint;
40
41/**
42 * Inventory of TE network topology.
43 */
44public interface TeTopologyStore
45 extends Store<TeTopologyEvent, TeTopologyStoreDelegate> {
46
47 /**
48 * Returns a collection of currently known networks.
49 *
50 * @return a collection of stored networks
51 */
52 List<Network> networks();
53
54 /**
55 * Returns a network.
56 *
57 * @param networkId network id in URI format
58 * @return value of network
59 */
60 Network network(KeyId networkId);
61
62 /**
63 * Updates a network.
64 *
65 * @param network value of the network to be updated
66 */
67 void updateNetwork(Network network);
68
69 /**
70 * Removes a network.
71 *
72 * @param networkId network id in URI format
73 */
74 void removeNetwork(KeyId networkId);
75
76 /**
77 * Returns a network link.
78 *
79 * @param linkKey link key
80 * @return value of network link
81 */
82 NetworkLink networkLink(NetworkLinkKey linkKey);
83
84 /**
85 * Updates a network link.
86 *
87 * @param linkKey link key
88 * @param link link object to be updated
89 */
90 void updateNetworkLink(NetworkLinkKey linkKey, NetworkLink link);
91
92 /**
93 * Removes a network link.
94 *
95 * @param linkKey link key
96 */
97 void removeNetworkLink(NetworkLinkKey linkKey);
98
99 /**
100 * Returns a network node.
101 *
102 * @param nodeKey node key
103 * @return value of network node
104 */
105 NetworkNode networkNode(NetworkNodeKey nodeKey);
106
107 /**
108 * Updates a network node.
109 *
110 * @param nodeKey node key
111 * @param node node object to be updated
112 */
113 void updateNetworkNode(NetworkNodeKey nodeKey, NetworkNode node);
114
115 /**
116 * Removes a network node.
117 *
118 * @param nodeKey node key
119 */
120 void removeNetworkNode(NetworkNodeKey nodeKey);
121
122 /**
123 * Updates a terminationPoint.
124 *
125 * @param terminationPointKey termination point id
126 * @param terminationPoint termination point object to be updated
127 */
128 void updateTerminationPoint(TerminationPointKey terminationPointKey,
129 TerminationPoint terminationPoint);
130
131 /**
132 * Removes a terminationPoint.
133 *
134 * @param terminationPointKey termination point id
135 */
136 void removeTerminationPoint(TerminationPointKey terminationPointKey);
137
138 /**
139 * Returns a collection of currently known TE topologies.
140 *
141 * @return a collection of topologies
142 */
143 TeTopologies teTopologies();
144
145 /**
146 * Returns the TE Topology identified by its Id.
147 *
148 * @param topologyId TE topology Key
149 * @return value of TeTopology
150 */
151 TeTopology teTopology(TeTopologyKey topologyId);
152
153 /**
154 * Creates or updates a TE topology.
155 *
156 * @param teTopology value of the TE topology to be updated
157 */
158 void updateTeTopology(TeTopology teTopology);
159
160 /**
161 * Removes the TE Topology identified by its Id.
162 *
163 * @param topologyId TE topology key
164 */
165 void removeTeTopology(TeTopologyKey topologyId);
166
167 /**
168 * Returns the TE node identified by its Id.
169 *
170 * @param nodeId the te node key
171 * @return value of node
172 */
173 TeNode teNode(TeNodeKey nodeId);
174
175 /**
176 * Creates or updates a TE Node.
177 *
178 * @param nodeKey te node id
179 * @param node node object to be updated
180 */
181 void updateTeNode(TeNodeKey nodeKey, TeNode node);
182
183 /**
184 * Removes the TE node identified by its Id.
185 *
186 * @param nodeId the te node key
187 */
188 void removeTeNode(TeNodeKey nodeId);
189
190 /**
191 * Returns the TE link identified by its Id.
192 *
193 * @param linkId the te link key
194 * @return value of link
195 */
196 TeLink teLink(TeLinkTpGlobalKey linkId);
197
198 /**
199 * Creates or updates a TE Link.
200 *
201 * @param linkKey link id
202 * @param link teLink object to be updated
203 */
204 void updateTeLink(TeLinkTpGlobalKey linkKey, TeLink link);
205
206 /**
207 * Removes the TE link identified by its Id.
208 *
209 * @param linkId the te link key
210 */
211 void removeTeLink(TeLinkTpGlobalKey linkId);
212
213 /**
214 * Returns a tunnel termination point identified by its id.
215 *
216 * @param ttpId the tunnel termination point key
217 * @return the tunnel termination point
218 */
219 TunnelTerminationPoint tunnelTerminationPoint(TtpKey ttpId);
220
221 /**
222 * Returns the network Id for a TE Topology key.
223 *
224 * @param teTopologyKey a TE topology key
225 * @return value of network Id
226 */
227 KeyId networkId(TeTopologyKey teTopologyKey);
228
229 /**
230 * Returns the network node key for a TE node key.
231 *
232 * @param teNodeKey a TE node key
233 * @return value of network node key
234 */
235 NetworkNodeKey nodeKey(TeNodeKey teNodeKey);
236
237 /**
238 * Returns the network link key for a TE link key.
239 *
240 * @param teLinkKey a TE node key
241 * @return value of network link key
242 */
243 NetworkLinkKey linkKey(TeLinkTpGlobalKey teLinkKey);
244
245 /**
246 * Returns the termination point key for a TE termination point key.
247 *
248 * @param teTpKey a TE termination point key
249 * @return value of termination point key
250 */
251 TerminationPointKey terminationPointKey(TeLinkTpGlobalKey teTpKey);
252
253 /**
254 * Returns the long value of next available TE topology id.
255 *
256 * @return value of TE topology id
257 */
258 long nextTeTopologyId();
259
260 /**
261 * Returns the next available TE node Id in a TE topology.
262 *
263 * @param topologyKey TE topology key
264 * @return value of TE node id
265 */
266 long nextTeNodeId(TeTopologyKey topologyKey);
267
268 /**
269 * Sets the next available TE node Id in a TE topology.
270 *
271 * @param topologyKey TE topology key
272 * @param nextNodeId value of next TE node id
273 */
274 void setNextTeNodeId(TeTopologyKey topologyKey, long nextNodeId);
275
276 /**
Yixiao Chen265b3bb2017-01-13 10:17:03 -0500277 * Returns the queue to store the events originating from consistent maps.
Yixiao Chen68bfab22016-11-11 11:04:10 -0500278 *
Yixiao Chen265b3bb2017-01-13 10:17:03 -0500279 * @return value of the blocking queue
Yixiao Chen68bfab22016-11-11 11:04:10 -0500280 */
Yixiao Chen265b3bb2017-01-13 10:17:03 -0500281 BlockingQueue<TeTopologyMapEvent> mapEventQueue();
Yixiao Chen68bfab22016-11-11 11:04:10 -0500282
Yixiao Chen29f06332016-12-07 16:14:29 -0500283 /**
284 * Sets the provider ID.
285 *
286 * @param providerId value of provider Id
287 */
288 void setProviderId(long providerId);
289
Yixiao Chen68bfab22016-11-11 11:04:10 -0500290}