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 org.onosproject.net.ElementId; |
| 19 | import org.onosproject.net.Path; |
| 20 | import org.onosproject.net.provider.Provider; |
| 21 | |
| 22 | /** |
| 23 | * Abstraction of an entity providing tunnel setup/release services to the core. |
| 24 | */ |
| 25 | public interface TunnelProvider extends Provider { |
| 26 | |
| 27 | /** |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 28 | * Instructs the provider to setup a tunnel. It's used by consumers. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 29 | * |
| 30 | * @param tunnel Tunnel |
| 31 | * @param path explicit route or null for the tunnel |
| 32 | */ |
| 33 | void setupTunnel(Tunnel tunnel, Path path); |
| 34 | |
| 35 | /** |
| 36 | * Instructs the provider to setup a tunnel given the respective device. |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 37 | * It's used by consumers. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 38 | * |
| 39 | * @param srcElement device |
| 40 | * @param tunnel Tunnel |
| 41 | * @param path explicit route (not null) for the tunnel |
| 42 | */ |
| 43 | void setupTunnel(ElementId srcElement, Tunnel tunnel, Path path); |
| 44 | |
| 45 | /** |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 46 | * Instructs the provider to release a tunnel. It's used by consumers. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 47 | * |
| 48 | * @param tunnel Tunnel |
| 49 | */ |
| 50 | void releaseTunnel(Tunnel tunnel); |
| 51 | |
| 52 | /** |
| 53 | * Instructs the provider to release a tunnel given the respective device. |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 54 | * It's used by consumers. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 55 | * |
| 56 | * @param srcElement device |
| 57 | * @param tunnel Tunnel |
| 58 | */ |
| 59 | void releaseTunnel(ElementId srcElement, Tunnel tunnel); |
| 60 | |
| 61 | /** |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 62 | * Instructs the provider to update a tunnel. It's used by consumers. Maybe |
| 63 | * some consumers enable to update a tunnel. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 64 | * |
| 65 | * @param tunnel Tunnel |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 66 | * @param path explicit route (path changed) or null (path not changed) for |
| 67 | * the tunnel |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 68 | */ |
| 69 | void updateTunnel(Tunnel tunnel, Path path); |
| 70 | |
| 71 | /** |
| 72 | * Instructs the provider to update a tunnel given the respective device. |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 73 | * It's used by consumers. Maybe some consumers enable to update a tunnel. |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 74 | * |
| 75 | * @param srcElement device |
| 76 | * @param tunnel Tunnel |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 77 | * @param path explicit route (path changed) or null (path not changed) for |
| 78 | * the tunnel |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 79 | */ |
| 80 | void updateTunnel(ElementId srcElement, Tunnel tunnel, Path path); |
| 81 | |
jcc | 4a20a5f | 2015-04-30 15:43:39 +0800 | [diff] [blame] | 82 | /** |
| 83 | * Signals that the provider has added a tunnel. It's used by producers. |
| 84 | * |
| 85 | * @param tunnel tunnel information |
| 86 | * @return tunnel identity |
| 87 | */ |
| 88 | TunnelId tunnelAdded(TunnelDescription tunnel); |
| 89 | |
| 90 | /** |
| 91 | * Signals that the provider has removed a tunnel. It's used by producers. |
| 92 | * |
| 93 | * @param tunnel tunnel information |
| 94 | */ |
| 95 | void tunnelRemoved(TunnelDescription tunnel); |
| 96 | |
| 97 | /** |
| 98 | * Signals that the a tunnel was changed (e.g., sensing changes of |
| 99 | * tunnel).It's used by producers. |
| 100 | * |
| 101 | * @param tunnel tunnel information |
| 102 | */ |
| 103 | void tunnelUpdated(TunnelDescription tunnel); |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 104 | } |