blob: c83b2c5307bf969468c2b4f54051922fa562dc29 [file] [log] [blame]
Thomas Vachuska7b438af2015-07-07 09:52:07 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.incubator.net.virtual;
17
18import com.google.common.annotations.Beta;
19import org.onosproject.net.DeviceId;
20
21import java.util.Set;
22
23/**
24 * Service for querying virtual network inventory.
25 */
26@Beta
27public interface VirtualNetworkService {
28
29 /**
Brian Stanke0e5c94e2016-03-08 11:20:04 -050030 * The topic used for obtaining globally unique ids.
31 */
32 String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids";
33
34 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070035 * Returns a collection of all virtual networks created on behalf of the
36 * specified tenant.
37 *
38 * @param tenantId tenant identifier
39 * @return collection of networks
40 * @throws org.onlab.util.ItemNotFoundException if no such network found
41 */
42 Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId);
43
44 /**
45 * Returns a collection of all virtual devices in the specified network.
46 *
47 * @param networkId network identifier
48 * @return collection of devices
49 * @throws org.onlab.util.ItemNotFoundException if no such network found
50 */
51 Set<VirtualDevice> getVirtualDevices(NetworkId networkId);
52
53 /**
54 * Returns collection of all virtual links in the specified network.
55 *
56 * @param networkId network identifier
57 * @return collection of links
58 * @throws org.onlab.util.ItemNotFoundException if no such network found
59 */
60 Set<VirtualLink> getVirtualLinks(NetworkId networkId);
61
62 /**
63 * Returns list of all virtual ports of the specified device.
64 *
65 * @param networkId network identifier
66 * @param deviceId device identifier
67 * @return list of ports
68 * @throws org.onlab.util.ItemNotFoundException if no such network found
69 */
70 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
71
72 /**
73 * Returns implementation of the specified service class for operating
74 * in the context of the given network.
75 * <p>
76 * The following services will be available:
77 * <ul>
78 * <li>{@link org.onosproject.net.device.DeviceService}</li>
79 * <li>{@link org.onosproject.net.link.LinkService}</li>
80 * <li>{@link org.onosproject.net.host.HostService}</li>
81 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
82 * <li>{@link org.onosproject.net.topology.PathService}</li>
83 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
84 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
85 * <li>{@link org.onosproject.net.intent.IntentService}</li>
86 * </ul>
87 *
88 * @param networkId network identifier
89 * @param serviceClass service class
90 * @param <T> type of service
91 * @return implementation class
92 * @throws org.onlab.util.ItemNotFoundException if no such network found
93 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
94 */
95 <T> T get(NetworkId networkId, Class<T> serviceClass);
96
97}