blob: 218c77d12add10749578da74ecc202ed42756728 [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;
21import org.onosproject.net.Port;
22import org.onosproject.net.PortNumber;
23import org.onosproject.store.Store;
24
25import java.util.Set;
26
27/**
28 * Mechanism for distributing and storing virtual network model information.
29 */
30public interface VirtualNetworkStore
31 extends Store<VirtualNetworkEvent, VirtualNetworkStoreDelegate> {
32
33 /**
34 * Adds a new tenant ID to the store.
35 *
36 * @param tenantId tenant identifier
37 */
38 void addTenantId(TenantId tenantId);
39
40 /**
41 * Removes the specified tenant ID from the store.
42 *
43 * @param tenantId tenant identifier
44 */
45 void removeTenantId(TenantId tenantId);
46
47 /**
48 * Returns set of registered tenant IDs.
49 *
50 * @return set of tenant identifiers
51 */
52 Set<TenantId> getTenantIds();
53
54 /**
55 * Adds a new virtual network for the specified tenant to the store.
56 *
57 * @param tenantId tenant identifier
58 * @return the virtual network
59 */
60 VirtualNetwork addNetwork(TenantId tenantId);
61
62 /**
63 * Removes the specified virtual network from the store.
64 *
65 * @param networkId network identifier
66 */
67 void removeNetwork(NetworkId networkId);
68
69 /**
70 * Adds a new virtual device to the store. This device will have no ports.
71 *
72 * @param networkId network identifier
73 * @param deviceId device identifier
74 * @return the virtual device
75 */
76 VirtualDevice addDevice(NetworkId networkId, DeviceId deviceId);
77
78 /**
79 * Renmoves the specified virtual device from the given network.
80 *
81 * @param networkId network identifier
82 * @param deviceId device identifier
83 */
84 void removeDevice(NetworkId networkId, DeviceId deviceId);
85
86 /**
87 * Adds a new virtual link.
88 *
89 * @param networkId network identifier
90 * @param src source end-point of the link
91 * @param dst destination end-point of the link
92 * @param realizedBy underlying tunnel using which this link is realized
93 * @return the virtual link
94 */
95 VirtualLink addLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst,
96 TunnelId realizedBy);
97
98 /**
99 * Removes the specified link from the store.
100 *
101 * @param networkId network identifier
102 * @param src source connection point
103 * @param dst destination connection point
104 */
105 void removeLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
106
107 /**
108 * Adds a new virtual port to the network.
109 *
110 * @param networkId network identifier
111 * @param deviceId device identifier
112 * @param portNumber port number
113 * @param realizedBy underlying port which realizes the virtual port
114 * @return the virtual port
115 */
116 VirtualPort addPort(NetworkId networkId, DeviceId deviceId,
117 PortNumber portNumber, Port realizedBy);
118
119 /**
120 * Removes the specified port from the given device and network.
121 *
122 * @param networkId network identifier
123 * @param deviceId device identifier
124 * @param portNumber port number
125 */
126 void removePort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
127
128 /**
129 * Returns the list of networks.
130 *
131 * @param tenantId tenant identifier
132 * @return set of virtual networks
133 */
134 Set<VirtualNetwork> getNetworks(TenantId tenantId);
135
136 /**
137 * Returns the list of devices in the specified virtual network.
138 *
139 * @param networkId network identifier
140 * @return set of virtual devices
141 */
142 Set<VirtualDevice> getDevices(NetworkId networkId);
143
144 /**
145 * Returns the list of virtual links in the specified virtual network.
146 *
147 * @param networkId network identifier
148 * @return set of virtual links
149 */
150 Set<VirtualLink> getLinks(NetworkId networkId);
151
152 /**
153 * Returns the list of ports of the specified virtual device.
154 *
155 * @param networkId network identifier
156 * @param deviceId device identifier
157 * @return set of virtual networks
158 */
159 Set<VirtualPort> getPorts(NetworkId networkId, DeviceId deviceId);
160
161}