Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net; |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 17 | |
Jonathan Hart | b79d641 | 2014-09-19 11:24:06 -0700 | [diff] [blame] | 18 | |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 19 | /** |
| 20 | * Abstraction of a network port. |
| 21 | */ |
tom | 3ea1125 | 2014-10-02 04:32:26 -0700 | [diff] [blame] | 22 | public interface Port extends Annotated { |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 23 | |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 24 | /** Represents coarse port type classification. */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 25 | enum Type { |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Signifies copper-based connectivity. |
| 28 | */ |
| 29 | COPPER, |
| 30 | |
| 31 | /** |
| 32 | * Signifies optical fiber-based connectivity. |
| 33 | */ |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 34 | FIBER, |
| 35 | |
| 36 | /** |
| 37 | * Signifies optical fiber-based packet port. |
| 38 | */ |
| 39 | PACKET, |
| 40 | |
| 41 | /** |
| 42 | * Signifies optical fiber-based optical tributary port (called T-port). |
| 43 | * The signal from the client side will be formed into a ITU G.709 (OTN) frame. |
| 44 | */ |
| 45 | ODUCLT, |
| 46 | |
| 47 | /** |
| 48 | * Signifies optical fiber-based Line-side port (called L-port). |
| 49 | */ |
| 50 | OCH, |
| 51 | |
| 52 | /** |
| 53 | * Signifies optical fiber-based WDM port (called W-port). |
| 54 | * Optical Multiplexing Section (See ITU G.709). |
| 55 | */ |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 56 | OMS, |
| 57 | |
| 58 | /** |
| 59 | * Signifies virtual port. |
| 60 | */ |
Rimon Ashkenazy | 8ebfff0 | 2016-02-01 11:56:36 +0200 | [diff] [blame] | 61 | VIRTUAL, |
| 62 | |
| 63 | /** |
| 64 | * Signifies optical fiber-based OTN port. |
| 65 | */ |
| 66 | OTU |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Returns the parent network element to which this port belongs. |
| 71 | * |
| 72 | * @return parent network element |
| 73 | */ |
| 74 | Element element(); |
| 75 | |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 76 | /** |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 77 | * Returns the port number. |
| 78 | * |
| 79 | * @return port number |
| 80 | */ |
| 81 | PortNumber number(); |
| 82 | |
| 83 | /** |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 84 | * Indicates whether or not the port is currently up and active. |
| 85 | * |
| 86 | * @return true if the port is operational |
| 87 | */ |
| 88 | boolean isEnabled(); |
| 89 | |
| 90 | /** |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 91 | * Returns the port type. |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 92 | * |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 93 | * @return port type |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 94 | */ |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 95 | Type type(); |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 96 | |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 97 | /** |
| 98 | * Returns the current port speed in Mbps. |
| 99 | * |
| 100 | * @return current port speed |
| 101 | */ |
| 102 | long portSpeed(); |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 103 | |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 104 | // TODO: more attributes? |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 105 | } |