wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.net.tunnel; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.net.ConnectPoint; |
| 21 | import org.onosproject.net.Path; |
| 22 | import org.onosproject.net.resource.Bandwidth; |
| 23 | |
| 24 | /** |
| 25 | * Service for interacting with the tunnel inventory. |
| 26 | */ |
| 27 | public interface TunnelService { |
| 28 | |
| 29 | /** |
| 30 | * Invokes the core to create a tunnel based on specified parameters. |
| 31 | * |
| 32 | * @param src sourcePoint |
| 33 | * @param dst destinationPoint |
| 34 | * @param bw bandwidth |
| 35 | * @param path explicit path or null |
| 36 | */ |
| 37 | void requestTunnel(ConnectPoint src, ConnectPoint dst, Bandwidth bw, Path path); |
| 38 | |
| 39 | /** |
| 40 | * Invokes the core to create a tunnel based on specified parameters with a tunnel type. |
| 41 | * |
| 42 | * @param src sourcePoint |
| 43 | * @param dst destinationPoint |
| 44 | * @param type tunnelType |
| 45 | * @param bw bandwidth |
| 46 | * @param path explicit path or null |
| 47 | */ |
| 48 | void requestTunnel(ConnectPoint src, ConnectPoint dst, Tunnel.Type type, Bandwidth bw, Path path); |
| 49 | |
| 50 | /** |
| 51 | * Returns the count of all known tunnels in the dataStore. |
| 52 | * |
| 53 | * @return number of tunnels |
| 54 | */ |
| 55 | int getTunnelCount(); |
| 56 | |
| 57 | /** |
| 58 | * Returns a collection of all known tunnel based on the type. |
| 59 | * |
wei wei | a668122 | 2015-04-21 14:58:22 -0500 | [diff] [blame^] | 60 | *@param type tunnelType |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 61 | * @return all tunnels for a specific type |
| 62 | */ |
| 63 | Collection<Tunnel> getTunnels(Tunnel.Type type); |
| 64 | |
| 65 | /** |
wei wei | a668122 | 2015-04-21 14:58:22 -0500 | [diff] [blame^] | 66 | * Returns set of all tunnels from the specified connectpoint. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 67 | * |
wei wei | a668122 | 2015-04-21 14:58:22 -0500 | [diff] [blame^] | 68 | * @param connectPoint device/portnumber |
| 69 | * @param type tunnelType |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 70 | * @return set of tunnels |
| 71 | */ |
| 72 | Collection<Tunnel> getTunnels(ConnectPoint connectPoint, Tunnel.Type type); |
| 73 | |
| 74 | /** |
| 75 | * Returns set of all tunnels from the |
| 76 | * specified source connectpoint and destination connectpoint. |
| 77 | * |
| 78 | * @param src sourcePoint |
| 79 | * @param dst destinationPoint |
| 80 | * @param type tunnel type |
| 81 | * @return set of tunnels |
| 82 | */ |
| 83 | Collection<Tunnel> getTunnels(ConnectPoint src, ConnectPoint dst, Tunnel.Type type); |
| 84 | |
| 85 | /** |
| 86 | * Returns the tunnel between the specified source |
| 87 | * and destination connection points. |
| 88 | * |
| 89 | * @param src source label |
| 90 | * @param dst destination label |
| 91 | * @return tunnel from source to destination; null if none found |
| 92 | */ |
| 93 | Tunnel getTunnel(Label src, Label dst); |
| 94 | |
| 95 | /** |
| 96 | * Returns the tunnel based on the Id. |
| 97 | * |
| 98 | * @param id tunnelId |
| 99 | * @return tunnel with specified Id |
| 100 | */ |
| 101 | Tunnel getTunnel(TunnelId id); |
| 102 | |
| 103 | /** |
| 104 | * Adds the specified tunnel listener. |
| 105 | * |
| 106 | * @param listener tunnel listener |
| 107 | */ |
| 108 | void addListener(TunnelListener listener); |
| 109 | |
| 110 | /** |
| 111 | * Removes the specified tunnel listener. |
| 112 | * |
| 113 | * @param listener tunnel listener |
| 114 | */ |
| 115 | void removeListener(TunnelListener listener); |
| 116 | |
| 117 | } |