cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | package org.onosproject.pcep.api; |
| 17 | |
chengfan | 359abf7 | 2015-07-02 23:33:16 +0800 | [diff] [blame] | 18 | import org.onosproject.net.Port; |
| 19 | |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 20 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 21 | * Abstraction of a network infrastructure link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 22 | */ |
| 23 | public interface PcepLink extends PcepOperator { |
| 24 | |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 25 | enum SubType { |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 26 | /** |
| 27 | * Optical Transmission Section Link. |
| 28 | */ |
| 29 | OTS, |
| 30 | |
| 31 | /** |
| 32 | * Optical Physical Section Link. |
| 33 | */ |
| 34 | OPS, |
| 35 | |
| 36 | /** |
| 37 | * User-to-Network Interface Link. |
| 38 | */ |
| 39 | UNI, |
| 40 | |
| 41 | /** |
| 42 | * Optical channel Data Unit-k link. |
| 43 | */ |
| 44 | ODUk, |
| 45 | |
| 46 | /** |
| 47 | * Optical Transport Network link. |
| 48 | */ |
| 49 | OTU, |
| 50 | } |
| 51 | |
| 52 | |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 53 | enum PortType { |
cheng fan | 7716ec9 | 2015-05-31 01:53:19 +0800 | [diff] [blame] | 54 | ODU_PORT, OCH_PORT, OMS_PORT |
| 55 | } |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 56 | |
| 57 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 58 | * Returns the link endpoint port type. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 59 | * |
| 60 | * @return endpoint port type |
| 61 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 62 | PortType portType(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 63 | |
| 64 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 65 | * Returns the link sub type,OTS,OPS,PKT_OPTICAL or ODUK. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 66 | * |
| 67 | * @return link subType |
| 68 | */ |
| 69 | |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 70 | SubType linkSubType(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 71 | |
| 72 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 73 | * Returns the link state, up or down. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 74 | * |
| 75 | * @return link state |
| 76 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 77 | String linkState(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 78 | |
| 79 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 80 | * Returns the distance of a link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 81 | * |
| 82 | * @return distance |
| 83 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 84 | int linkDistance(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 85 | |
| 86 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 87 | * Returns the capacity type of a link,1: WAVELENGTHNUM, 2:SLOTNUM, 3, |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 88 | * BANDWIDTH. |
| 89 | * |
| 90 | * @return capacity type |
| 91 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 92 | String linkCapacityType(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 93 | |
| 94 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 95 | * Returns the available capacity value ,such as available bandwidth. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 96 | * |
| 97 | * @return availValue |
| 98 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 99 | int linkAvailValue(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 100 | |
| 101 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 102 | * Returns the max capacity value ,such as max bandwidth. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 103 | * |
| 104 | * @return maxValue |
| 105 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 106 | int linkMaxValue(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 107 | |
| 108 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 109 | * Returns the source device did of a link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 110 | * |
| 111 | * @return source did |
| 112 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 113 | PcepDpid linkSrcDeviceID(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 114 | |
| 115 | /** |
chengfan | 3e61879 | 2015-06-28 21:42:01 +0800 | [diff] [blame] | 116 | * Returns the destination device did of a link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 117 | * |
| 118 | * @return destination did |
| 119 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 120 | PcepDpid linkDstDeviceId(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 121 | |
| 122 | /** |
chengfan | 359abf7 | 2015-07-02 23:33:16 +0800 | [diff] [blame] | 123 | * Returns the source port of a link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 124 | * |
| 125 | * @return port number |
| 126 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 127 | Port linkSrcPort(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 128 | |
| 129 | /** |
chengfan | 359abf7 | 2015-07-02 23:33:16 +0800 | [diff] [blame] | 130 | * Returns the destination port of a link. |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 131 | * |
| 132 | * @return port number |
| 133 | */ |
chengfan | 373aac5 | 2015-08-17 15:36:44 -0500 | [diff] [blame] | 134 | Port linkDstPort(); |
cheng fan | 48e832c | 2015-05-29 01:54:47 +0800 | [diff] [blame] | 135 | |
| 136 | } |