tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [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 | |
| 17 | package org.onosproject.tetunnel.api; |
| 18 | |
| 19 | import org.onosproject.incubator.net.tunnel.Tunnel; |
| 20 | import org.onosproject.incubator.net.tunnel.TunnelId; |
chenqinghui | 86320ae | 2016-12-01 15:40:39 +0800 | [diff] [blame] | 21 | import org.onosproject.tetunnel.api.lsp.TeLsp; |
| 22 | import org.onosproject.tetunnel.api.lsp.TeLspKey; |
tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 23 | import org.onosproject.tetunnel.api.tunnel.TeTunnel; |
| 24 | import org.onosproject.tetunnel.api.tunnel.TeTunnelKey; |
| 25 | |
| 26 | /** |
| 27 | * Service through which tunnel providers can inject TE Tunnel attributes |
| 28 | * into the system. |
| 29 | * <p> |
| 30 | * Please note that this service works with the existing Tunnel subsystem |
| 31 | * together, just as an extension to the tunnel subsystem, and only focus on TE |
| 32 | * Tunnel attributes management. |
| 33 | */ |
| 34 | public interface TeTunnelProviderService { |
| 35 | |
| 36 | /** |
| 37 | * Signals that a TE Tunnel is created with supplied attributes. |
| 38 | * |
| 39 | * @param teTunnel new created TE Tunnel attributes |
| 40 | * @return created tunnel identifier or null if failed |
| 41 | */ |
| 42 | TunnelId teTunnelAdded(TeTunnel teTunnel); |
| 43 | |
| 44 | /** |
| 45 | * Signals that a TE Tunnel with specified attributes is removed. |
| 46 | * |
| 47 | * @param teTunnel removed TE Tunnel |
| 48 | */ |
| 49 | void teTunnelRemoved(TeTunnel teTunnel); |
| 50 | |
| 51 | /** |
| 52 | * Updates TE Tunnel attributes with supplied information, the old |
| 53 | * attributes will be totally overwrote by the new attributes. |
| 54 | * |
| 55 | * @param teTunnel new TE Tunnel attributes |
| 56 | */ |
| 57 | void updateTeTunnel(TeTunnel teTunnel); |
| 58 | |
| 59 | /** |
| 60 | * Updates state of a TE tunnel specified by the given key. |
| 61 | * |
| 62 | * @param key TE tunnel key |
| 63 | * @param state new state of the tunnel |
| 64 | */ |
| 65 | void updateTunnelState(TeTunnelKey key, Tunnel.State state); |
| 66 | |
chenqinghui | 86320ae | 2016-12-01 15:40:39 +0800 | [diff] [blame] | 67 | /** |
| 68 | * Signifies that a TE LSP is created. |
| 69 | * |
| 70 | * @param lsp new created TE LSP attributes |
| 71 | * @return key of the TE LSP or null if failed |
| 72 | */ |
| 73 | TeLspKey teLspAdded(TeLsp lsp); |
| 74 | |
| 75 | /** |
| 76 | * Signifies that a TE LSP is removed. |
| 77 | * |
| 78 | * @param lsp removed TE LSP |
| 79 | */ |
| 80 | void teLspRemoved(TeLsp lsp); |
| 81 | |
| 82 | /** |
| 83 | * Updates TE LSP attributes. |
| 84 | * |
| 85 | * @param lsp new TE LSP attributes |
| 86 | */ |
| 87 | void updateTeLsp(TeLsp lsp); |
| 88 | |
tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 89 | //TODO: add interfaces for teGlobal and teLspState |
| 90 | } |