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; |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 19 | import org.onlab.osgi.ServiceDirectory; |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame^] | 20 | import org.onosproject.core.ApplicationId; |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 21 | import org.onosproject.net.DeviceId; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Service for querying virtual network inventory. |
| 27 | */ |
| 28 | @Beta |
| 29 | public interface VirtualNetworkService { |
| 30 | |
| 31 | /** |
Brian Stanke | 0e5c94e | 2016-03-08 11:20:04 -0500 | [diff] [blame] | 32 | * The topic used for obtaining globally unique ids. |
| 33 | */ |
| 34 | String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids"; |
| 35 | |
| 36 | /** |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 37 | * Returns a collection of all virtual networks created on behalf of the |
| 38 | * specified tenant. |
| 39 | * |
| 40 | * @param tenantId tenant identifier |
| 41 | * @return collection of networks |
| 42 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 43 | */ |
| 44 | Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId); |
| 45 | |
| 46 | /** |
| 47 | * Returns a collection of all virtual devices in the specified network. |
| 48 | * |
| 49 | * @param networkId network identifier |
| 50 | * @return collection of devices |
| 51 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 52 | */ |
| 53 | Set<VirtualDevice> getVirtualDevices(NetworkId networkId); |
| 54 | |
| 55 | /** |
Brian Stanke | 7a81b53 | 2016-06-14 15:43:51 -0400 | [diff] [blame] | 56 | * Returns a collection of all virtual hosts in the specified network. |
| 57 | * |
| 58 | * @param networkId network identifier |
| 59 | * @return collection of hosts |
| 60 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 61 | */ |
| 62 | Set<VirtualHost> getVirtualHosts(NetworkId networkId); |
| 63 | |
| 64 | /** |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 65 | * Returns collection of all virtual links in the specified network. |
| 66 | * |
| 67 | * @param networkId network identifier |
| 68 | * @return collection of links |
| 69 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 70 | */ |
| 71 | Set<VirtualLink> getVirtualLinks(NetworkId networkId); |
| 72 | |
| 73 | /** |
Brian Stanke | 612cebf | 2016-05-02 10:21:33 -0400 | [diff] [blame] | 74 | * Returns list of all virtual ports of the specified device. If the |
| 75 | * device identifier is null then all of the virtual ports in the specified |
| 76 | * network will be returned. |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 77 | * |
| 78 | * @param networkId network identifier |
| 79 | * @param deviceId device identifier |
| 80 | * @return list of ports |
| 81 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 82 | */ |
| 83 | Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId); |
| 84 | |
| 85 | /** |
| 86 | * Returns implementation of the specified service class for operating |
| 87 | * in the context of the given network. |
| 88 | * <p> |
| 89 | * The following services will be available: |
| 90 | * <ul> |
| 91 | * <li>{@link org.onosproject.net.device.DeviceService}</li> |
| 92 | * <li>{@link org.onosproject.net.link.LinkService}</li> |
| 93 | * <li>{@link org.onosproject.net.host.HostService}</li> |
| 94 | * <li>{@link org.onosproject.net.topology.TopologyService}</li> |
| 95 | * <li>{@link org.onosproject.net.topology.PathService}</li> |
| 96 | * <li>{@link org.onosproject.net.flow.FlowRuleService}</li> |
| 97 | * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li> |
| 98 | * <li>{@link org.onosproject.net.intent.IntentService}</li> |
| 99 | * </ul> |
| 100 | * |
| 101 | * @param networkId network identifier |
| 102 | * @param serviceClass service class |
| 103 | * @param <T> type of service |
| 104 | * @return implementation class |
| 105 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 106 | * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found |
| 107 | */ |
| 108 | <T> T get(NetworkId networkId, Class<T> serviceClass); |
| 109 | |
yoonseon | c6a6927 | 2017-01-12 18:22:20 -0800 | [diff] [blame] | 110 | /** |
| 111 | * Returns service directory. |
| 112 | * |
| 113 | * @return a service directory |
| 114 | */ |
| 115 | ServiceDirectory getServiceDirectory(); |
yoonseon | 322c9c3 | 2016-12-07 16:47:02 -0800 | [diff] [blame^] | 116 | |
| 117 | /** |
| 118 | * Returns the application identifier for a virtual network. |
| 119 | * |
| 120 | * @param networkId network identifier |
| 121 | * @return an representative application identifier for a virtual network |
| 122 | */ |
| 123 | ApplicationId getVirtualNetworkApplicationId(NetworkId networkId); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 124 | } |