Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.incubator.net.virtual; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Service for querying virtual network inventory. |
| 25 | */ |
| 26 | @Beta |
| 27 | public interface VirtualNetworkService { |
| 28 | |
| 29 | /** |
Brian Stanke | 0e5c94e | 2016-03-08 11:20:04 -0500 | [diff] [blame] | 30 | * The topic used for obtaining globally unique ids. |
| 31 | */ |
| 32 | String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids"; |
| 33 | |
| 34 | /** |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 35 | * 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 Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame^] | 63 | * 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 Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 66 | * |
| 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 | } |