chenqinghui | 86320ae | 2016-12-01 15:40:39 +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.lsp; |
| 18 | |
| 19 | import org.onosproject.tetopology.management.api.node.TeNodeKey; |
| 20 | import org.onosproject.tetopology.management.api.node.TtpKey; |
| 21 | import org.onosproject.tetunnel.api.tunnel.TeTunnel; |
| 22 | import org.onosproject.tetunnel.api.tunnel.TeTunnelKey; |
| 23 | import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject; |
| 24 | |
| 25 | import java.util.List; |
| 26 | |
| 27 | /** |
| 28 | * Representation of a TE LSP. |
| 29 | */ |
| 30 | public interface TeLsp { |
| 31 | |
| 32 | /** |
| 33 | * Protection roles of TE LSP. |
| 34 | */ |
| 35 | enum LspProtectionRole { |
| 36 | /** |
| 37 | * Designates a working LSP. |
| 38 | */ |
| 39 | WORKING, |
| 40 | /** |
| 41 | * Designates a protection LSP. |
| 42 | */ |
| 43 | PROTECTION |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Origin type of LSP relative to the location of the local switch in the |
| 48 | * path. |
| 49 | */ |
| 50 | enum OriginType { |
| 51 | INGRESS, |
| 52 | EGRESS, |
| 53 | TRANSIT |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Returns key of this TE LSP. |
| 58 | * |
| 59 | * @return key of this TE LSP |
| 60 | */ |
| 61 | TeLspKey teLspKey(); |
| 62 | |
| 63 | /** |
| 64 | * Returns source TE node of this tunnel. |
| 65 | * |
| 66 | * @return source TE node key |
| 67 | */ |
| 68 | TeNodeKey srcNode(); |
| 69 | |
| 70 | /** |
| 71 | * Returns source TE termination point of this tunnel. |
| 72 | * |
| 73 | * @return source TE termination point key |
| 74 | */ |
| 75 | TtpKey srcTp(); |
| 76 | |
| 77 | /** |
| 78 | * Returns destination TE node of this tunnel. |
| 79 | * |
| 80 | * @return destination TE node key |
| 81 | */ |
| 82 | TeNodeKey dstNode(); |
| 83 | |
| 84 | /** |
| 85 | * Returns destination TE termination point of this tunnel. |
| 86 | * |
| 87 | * @return destination TE termination point key |
| 88 | */ |
| 89 | TtpKey dstTp(); |
| 90 | |
| 91 | /** |
| 92 | * Returns the TE tunnel used in the SESSION that remains constant over |
| 93 | * the life of the tunnel. |
| 94 | * |
| 95 | * @return TE tunnel key |
| 96 | */ |
| 97 | TeTunnelKey teTunnelKey(); |
| 98 | |
| 99 | /** |
| 100 | * Returns corresponding tunnel type. |
| 101 | * |
| 102 | * @return TE tunnel type |
| 103 | */ |
| 104 | TeTunnel.Type tunnelType(); |
| 105 | |
| 106 | /** |
| 107 | * Returns operational status of the LSP. |
| 108 | * |
| 109 | * @return operational status |
| 110 | */ |
| 111 | TeTunnel.State operStatus(); |
| 112 | |
| 113 | /** |
| 114 | * Returns protection role of the LSP. |
| 115 | * |
| 116 | * @return protection role |
| 117 | */ |
| 118 | LspProtectionRole lspProtectionRole(); |
| 119 | |
| 120 | /** |
| 121 | * Return origin type of the LSP. |
| 122 | * |
| 123 | * @return origin type |
| 124 | */ |
| 125 | OriginType originType(); |
| 126 | |
| 127 | /** |
| 128 | * Returns route of this LSP. |
| 129 | * |
| 130 | * @return list of TeRouteSubobject |
| 131 | */ |
| 132 | List<TeRouteSubobject> lspRecordRoutes(); |
| 133 | |
| 134 | //TODO add more attributes here. |
| 135 | } |