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