blob: 01681ef44512566ecac16a36046373b86a1052dc [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 /**
30 * Returns a collection of all virtual networks created on behalf of the
31 * specified tenant.
32 *
33 * @param tenantId tenant identifier
34 * @return collection of networks
35 * @throws org.onlab.util.ItemNotFoundException if no such network found
36 */
37 Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId);
38
39 /**
40 * Returns a collection of all virtual devices in the specified network.
41 *
42 * @param networkId network identifier
43 * @return collection of devices
44 * @throws org.onlab.util.ItemNotFoundException if no such network found
45 */
46 Set<VirtualDevice> getVirtualDevices(NetworkId networkId);
47
48 /**
49 * Returns collection of all virtual links in the specified network.
50 *
51 * @param networkId network identifier
52 * @return collection of links
53 * @throws org.onlab.util.ItemNotFoundException if no such network found
54 */
55 Set<VirtualLink> getVirtualLinks(NetworkId networkId);
56
57 /**
58 * Returns list of all virtual ports of the specified device.
59 *
60 * @param networkId network identifier
61 * @param deviceId device identifier
62 * @return list of ports
63 * @throws org.onlab.util.ItemNotFoundException if no such network found
64 */
65 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
66
67 /**
68 * Returns implementation of the specified service class for operating
69 * in the context of the given network.
70 * <p>
71 * The following services will be available:
72 * <ul>
73 * <li>{@link org.onosproject.net.device.DeviceService}</li>
74 * <li>{@link org.onosproject.net.link.LinkService}</li>
75 * <li>{@link org.onosproject.net.host.HostService}</li>
76 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
77 * <li>{@link org.onosproject.net.topology.PathService}</li>
78 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
79 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
80 * <li>{@link org.onosproject.net.intent.IntentService}</li>
81 * </ul>
82 *
83 * @param networkId network identifier
84 * @param serviceClass service class
85 * @param <T> type of service
86 * @return implementation class
87 * @throws org.onlab.util.ItemNotFoundException if no such network found
88 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
89 */
90 <T> T get(NetworkId networkId, Class<T> serviceClass);
91
92}