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; |
| 21 | import org.onosproject.tetunnel.api.tunnel.TeTunnel; |
| 22 | import org.onosproject.tetunnel.api.tunnel.TeTunnelKey; |
| 23 | |
| 24 | import java.util.List; |
| 25 | |
| 26 | /** |
| 27 | * Service for administering the TE Tunnel attributes. |
| 28 | * <p> |
| 29 | * Please note that this service works with the existing Tunnel subsystem |
| 30 | * together, just as an extension to the tunnel subsystem, and only focuses |
| 31 | * on TE Tunnel attributes management. |
| 32 | */ |
| 33 | public interface TeTunnelAdminService extends TeTunnelService { |
| 34 | |
| 35 | /** |
| 36 | * Creates a TE Tunnel with the supplied attributes, and returns an |
| 37 | * identifier for the tunnel on success, or null on failure. |
| 38 | * |
| 39 | * @param teTunnel TE Tunnel attributes |
| 40 | * @return created tunnel identifier or null if failed |
| 41 | */ |
| 42 | TunnelId createTeTunnel(TeTunnel teTunnel); |
| 43 | |
| 44 | /** |
| 45 | * Sets the corresponding Tunnel identifier of the TE Tunnel specified |
| 46 | * by the given key. |
| 47 | * |
| 48 | * @param teTunnelKey TE Tunnel key |
| 49 | * @param tunnelId corresponding tunnel identifier |
| 50 | */ |
| 51 | void setTunnelId(TeTunnelKey teTunnelKey, TunnelId tunnelId); |
| 52 | |
| 53 | /** |
| 54 | * Updates TE Tunnel attributes with supplied information, the old |
| 55 | * attributes will be totally overwrote by the new attributes. |
| 56 | * |
| 57 | * @param teTunnel new TE Tunnel attributes |
| 58 | */ |
| 59 | void updateTeTunnel(TeTunnel teTunnel); |
| 60 | |
| 61 | /** |
| 62 | * Updates state of a TE tunnel specified by the given key. |
| 63 | * |
| 64 | * @param key TE tunnel key |
| 65 | * @param state new state of the tunnel |
| 66 | */ |
| 67 | void updateTunnelState(TeTunnelKey key, Tunnel.State state); |
| 68 | |
| 69 | /** |
| 70 | * Removes a TE Tunnel specified by the given key. |
| 71 | * |
| 72 | * @param teTunnelKey TE Tunnel key |
| 73 | */ |
| 74 | void removeTeTunnel(TeTunnelKey teTunnelKey); |
| 75 | |
| 76 | /** |
| 77 | * Sets segment tunnels of a E2E cross-domain tunnel. |
| 78 | * |
| 79 | * @param e2eTunnelKey key of the E2E tunnel |
| 80 | * @param segmentTunnels list of segment tunnels |
| 81 | */ |
| 82 | void setSegmentTunnel(TeTunnelKey e2eTunnelKey, |
| 83 | List<TeTunnelKey> segmentTunnels); |
| 84 | |
| 85 | //TODO: add interfaces for teGlobal and teLspState |
| 86 | } |