tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present 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 | |
| 17 | package org.onosproject.tetunnel.api; |
| 18 | |
| 19 | import org.onosproject.incubator.net.tunnel.TunnelId; |
| 20 | import org.onosproject.tetopology.management.api.TeTopologyKey; |
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 | import java.util.Collection; |
| 27 | |
| 28 | /** |
| 29 | * Manages TE tunnel attributes. |
| 30 | * <p> |
| 31 | * Please note that this service works with the existing Tunnel subsystem |
| 32 | * together, just as an extension to the tunnel subsystem, and only focus on TE |
| 33 | * Tunnel attributes management. |
| 34 | */ |
| 35 | public interface TeTunnelStore { |
| 36 | |
| 37 | /** |
| 38 | * Creates a TE Tunnel with the supplied attributes, and returns true on |
| 39 | * success, or false on failure. |
| 40 | * |
| 41 | * @param teTunnel TE Tunnel attributes |
| 42 | * @return true on success, or false on failure |
| 43 | */ |
| 44 | boolean addTeTunnel(TeTunnel teTunnel); |
| 45 | |
| 46 | /** |
| 47 | * Sets the corresponding Tunnel identifier of the TE Tunnel specified |
| 48 | * by the given key. |
| 49 | * |
| 50 | * @param teTunnelKey TE Tunnel key |
| 51 | * @param tunnelId corresponding tunnel identifier |
| 52 | */ |
| 53 | void setTunnelId(TeTunnelKey teTunnelKey, TunnelId tunnelId); |
| 54 | |
| 55 | /** |
| 56 | * Returns the corresponding Tunnel identifier of the TE tunnel. |
| 57 | * |
| 58 | * @param teTunnelKey TE Tunnel key |
| 59 | * @return corresponding Tunnel identifier |
| 60 | */ |
| 61 | TunnelId getTunnelId(TeTunnelKey teTunnelKey); |
| 62 | |
| 63 | /** |
| 64 | * Updates TE Tunnel attributes with supplied information, the old |
| 65 | * attributes will be totally overwrote by the new attributes. |
| 66 | * |
| 67 | * @param teTunnel new TE Tunnel attributes |
| 68 | */ |
| 69 | void updateTeTunnel(TeTunnel teTunnel); |
| 70 | |
| 71 | /** |
| 72 | * Removes a TE Tunnel specified by the given key. |
| 73 | * |
| 74 | * @param teTunnelKey TE Tunnel key |
| 75 | */ |
| 76 | void removeTeTunnel(TeTunnelKey teTunnelKey); |
| 77 | |
| 78 | /** |
| 79 | * Returns the TE Tunnel with the specified key. |
| 80 | * |
| 81 | * @param teTunnelKey TE Tunnel key |
| 82 | * @return TeTunnel or null if one with the given key is not known |
| 83 | */ |
| 84 | TeTunnel getTeTunnel(TeTunnelKey teTunnelKey); |
| 85 | |
| 86 | /** |
| 87 | * Returns the TE Tunnel with the specified identifier. |
| 88 | * |
| 89 | * @param tunnelId corresponding tunnel identifier |
| 90 | * @return TeTunnel or null if one with the given identifier is not known |
| 91 | */ |
| 92 | TeTunnel getTeTunnel(TunnelId tunnelId); |
| 93 | |
| 94 | |
| 95 | /** |
| 96 | * Returns a collection of currently known TE Tunnels. |
| 97 | * |
| 98 | * @return collection of TeTunnels |
| 99 | */ |
| 100 | Collection<TeTunnel> getTeTunnels(); |
| 101 | |
| 102 | /** |
| 103 | * Returns a collection of currently known TE Tunnels filtered by the |
| 104 | * specified TE tunnel type. |
| 105 | * |
| 106 | * @param type TE tunnel type to filter by |
| 107 | * @return filtered collection of TE tunnels |
| 108 | */ |
| 109 | Collection<TeTunnel> getTeTunnels(TeTunnel.Type type); |
| 110 | |
| 111 | /** |
| 112 | * Returns a collection of currently known TE tunnels filtered by specified |
| 113 | * TE topology key. |
| 114 | * |
| 115 | * @param teTopologyKey TE topology key to filter by |
| 116 | * @return filtered collection of TE tunnels |
| 117 | */ |
| 118 | Collection<TeTunnel> getTeTunnels(TeTopologyKey teTopologyKey); |
chenqinghui | 86320ae | 2016-12-01 15:40:39 +0800 | [diff] [blame^] | 119 | |
| 120 | /** |
| 121 | * Adds a TE LSP. |
| 122 | * |
| 123 | * @param lsp TE LSP attributes |
| 124 | * @return true when success |
| 125 | */ |
| 126 | boolean addTeLsp(TeLsp lsp); |
| 127 | |
| 128 | /** |
| 129 | * Updates TE LSP attributes. |
| 130 | * |
| 131 | * @param lsp new TE LSP attributes |
| 132 | */ |
| 133 | void updateTeLsp(TeLsp lsp); |
| 134 | |
| 135 | /** |
| 136 | * Removes a TE LSP. |
| 137 | * |
| 138 | * @param key TE LSP key |
| 139 | */ |
| 140 | void removeTeLsp(TeLspKey key); |
| 141 | |
| 142 | /** |
| 143 | * Returns the TE LSP with the specified key. |
| 144 | * |
| 145 | * @param key TE LSP key |
| 146 | * @return TeLsp or null if one with the given key is not known |
| 147 | */ |
| 148 | TeLsp getTeLsp(TeLspKey key); |
| 149 | |
| 150 | /** |
| 151 | * Returns a collection of currently known TE LSP. |
| 152 | * |
| 153 | * @return collection of TeLsp |
| 154 | */ |
| 155 | Collection<TeLsp> getTeLsps(); |
tony-liu | aff59a7 | 2016-10-21 15:41:46 +0800 | [diff] [blame] | 156 | } |