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