blob: 663c20882a156925d6b0bea2b69def73e4229c59 [file] [log] [blame]
Thomas Vachuska33979fd2015-07-31 11:41:14 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska33979fd2015-07-31 11:41:14 -07003 *
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.incubator.net.virtual;
17
18import org.onosproject.incubator.net.tunnel.TunnelId;
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
Brian Stanke612cebf2016-05-02 10:21:33 -040021import org.onosproject.net.Link;
Thomas Vachuska33979fd2015-07-31 11:41:14 -070022import org.onosproject.net.Port;
23import org.onosproject.net.PortNumber;
24import org.onosproject.store.Store;
25
26import java.util.Set;
27
28/**
29 * Mechanism for distributing and storing virtual network model information.
30 */
31public interface VirtualNetworkStore
32 extends Store<VirtualNetworkEvent, VirtualNetworkStoreDelegate> {
33
34 /**
35 * Adds a new tenant ID to the store.
36 *
37 * @param tenantId tenant identifier
38 */
39 void addTenantId(TenantId tenantId);
40
41 /**
42 * Removes the specified tenant ID from the store.
43 *
44 * @param tenantId tenant identifier
45 */
46 void removeTenantId(TenantId tenantId);
47
48 /**
49 * Returns set of registered tenant IDs.
50 *
51 * @return set of tenant identifiers
52 */
53 Set<TenantId> getTenantIds();
54
55 /**
56 * Adds a new virtual network for the specified tenant to the store.
57 *
58 * @param tenantId tenant identifier
59 * @return the virtual network
60 */
61 VirtualNetwork addNetwork(TenantId tenantId);
62
63 /**
64 * Removes the specified virtual network from the store.
65 *
66 * @param networkId network identifier
67 */
68 void removeNetwork(NetworkId networkId);
69
70 /**
71 * Adds a new virtual device to the store. This device will have no ports.
72 *
73 * @param networkId network identifier
74 * @param deviceId device identifier
75 * @return the virtual device
76 */
77 VirtualDevice addDevice(NetworkId networkId, DeviceId deviceId);
78
79 /**
80 * Renmoves the specified virtual device from the given network.
81 *
82 * @param networkId network identifier
83 * @param deviceId device identifier
84 */
85 void removeDevice(NetworkId networkId, DeviceId deviceId);
86
87 /**
88 * Adds a new virtual link.
89 *
90 * @param networkId network identifier
91 * @param src source end-point of the link
92 * @param dst destination end-point of the link
Brian Stanke612cebf2016-05-02 10:21:33 -040093 * @param state link state
Brian Stanke9a108972016-04-11 15:25:17 -040094 * @param realizedBy underlying tunnel identifier using which this link is realized
Thomas Vachuska33979fd2015-07-31 11:41:14 -070095 * @return the virtual link
96 */
Brian Stanke612cebf2016-05-02 10:21:33 -040097 VirtualLink addLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst, Link.State state, TunnelId realizedBy);
Brian Stanke9a108972016-04-11 15:25:17 -040098
99 /**
100 * Updates the tunnelId in the virtual link.
101 *
Brian Stanke612cebf2016-05-02 10:21:33 -0400102 * @param virtualLink virtual link
103 * @param tunnelId tunnel identifier
104 * @param state link state
Brian Stanke9a108972016-04-11 15:25:17 -0400105 */
Brian Stanke612cebf2016-05-02 10:21:33 -0400106 void updateLink(VirtualLink virtualLink, TunnelId tunnelId, Link.State state);
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700107
108 /**
109 * Removes the specified link from the store.
110 *
111 * @param networkId network identifier
112 * @param src source connection point
113 * @param dst destination connection point
Brian Stanke9a108972016-04-11 15:25:17 -0400114 * @return the virtual link
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700115 */
Brian Stanke9a108972016-04-11 15:25:17 -0400116 VirtualLink removeLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700117
118 /**
119 * Adds a new virtual port to the network.
120 *
121 * @param networkId network identifier
122 * @param deviceId device identifier
123 * @param portNumber port number
124 * @param realizedBy underlying port which realizes the virtual port
125 * @return the virtual port
126 */
127 VirtualPort addPort(NetworkId networkId, DeviceId deviceId,
128 PortNumber portNumber, Port realizedBy);
129
130 /**
131 * Removes the specified port from the given device and network.
132 *
133 * @param networkId network identifier
134 * @param deviceId device identifier
135 * @param portNumber port number
136 */
137 void removePort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
138
139 /**
140 * Returns the list of networks.
141 *
142 * @param tenantId tenant identifier
143 * @return set of virtual networks
144 */
145 Set<VirtualNetwork> getNetworks(TenantId tenantId);
146
147 /**
148 * Returns the list of devices in the specified virtual network.
149 *
150 * @param networkId network identifier
151 * @return set of virtual devices
152 */
153 Set<VirtualDevice> getDevices(NetworkId networkId);
154
155 /**
156 * Returns the list of virtual links in the specified virtual network.
157 *
158 * @param networkId network identifier
159 * @return set of virtual links
160 */
161 Set<VirtualLink> getLinks(NetworkId networkId);
162
163 /**
Brian Stanke612cebf2016-05-02 10:21:33 -0400164 * Returns the virtual link matching the network identifier, source connect point,
165 * and destination connect point.
166 *
167 * @param networkId network identifier
168 * @param src source connect point
169 * @param dst destination connect point
170 * @return virtual link
171 */
172 VirtualLink getLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
173
174 /**
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700175 * Returns the list of ports of the specified virtual device.
176 *
177 * @param networkId network identifier
Brian Stanke612cebf2016-05-02 10:21:33 -0400178 * @param deviceId device identifier
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700179 * @return set of virtual networks
180 */
181 Set<VirtualPort> getPorts(NetworkId networkId, DeviceId deviceId);
182
183}