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