blob: ebe0b691f5b466ac259ef75c9628c2feb9ae6f44 [file] [log] [blame]
Thomas Vachuska7b438af2015-07-07 09:52:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska7b438af2015-07-07 09:52:07 -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 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 /**
Brian Stanke612cebf2016-05-02 10:21:33 -040063 * Returns list of all virtual ports of the specified device. If the
64 * device identifier is null then all of the virtual ports in the specified
65 * network will be returned.
Thomas Vachuska7b438af2015-07-07 09:52:07 -070066 *
67 * @param networkId network identifier
68 * @param deviceId device identifier
69 * @return list of ports
70 * @throws org.onlab.util.ItemNotFoundException if no such network found
71 */
72 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
73
74 /**
75 * Returns implementation of the specified service class for operating
76 * in the context of the given network.
77 * <p>
78 * The following services will be available:
79 * <ul>
80 * <li>{@link org.onosproject.net.device.DeviceService}</li>
81 * <li>{@link org.onosproject.net.link.LinkService}</li>
82 * <li>{@link org.onosproject.net.host.HostService}</li>
83 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
84 * <li>{@link org.onosproject.net.topology.PathService}</li>
85 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
86 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
87 * <li>{@link org.onosproject.net.intent.IntentService}</li>
88 * </ul>
89 *
90 * @param networkId network identifier
91 * @param serviceClass service class
92 * @param <T> type of service
93 * @return implementation class
94 * @throws org.onlab.util.ItemNotFoundException if no such network found
95 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
96 */
97 <T> T get(NetworkId networkId, Class<T> serviceClass);
98
99}