blob: d70b1e17a95e008003fa4ef2caf6dfe79e3d480a [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net;
tomb36046e2014-08-27 00:22:24 -070017
Jonathan Hartb79d6412014-09-19 11:24:06 -070018
tomb36046e2014-08-27 00:22:24 -070019/**
20 * Abstraction of a network port.
21 */
tom3ea11252014-10-02 04:32:26 -070022public interface Port extends Annotated {
tomb36046e2014-08-27 00:22:24 -070023
Thomas Vachuskad16ce182014-10-29 17:25:29 -070024 /** Represents coarse port type classification. */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070025 enum Type {
Thomas Vachuskad16ce182014-10-29 17:25:29 -070026 /**
27 * Signifies copper-based connectivity.
28 */
29 COPPER,
30
31 /**
32 * Signifies optical fiber-based connectivity.
33 */
wei wei89ddc322015-03-22 16:29:04 -050034 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 Vachuska7b438af2015-07-07 09:52:07 -070056 OMS,
57
58 /**
59 * Signifies virtual port.
60 */
61 VIRTUAL
Thomas Vachuskad16ce182014-10-29 17:25:29 -070062 }
63
64 /**
65 * Returns the parent network element to which this port belongs.
66 *
67 * @return parent network element
68 */
69 Element element();
70
tomca20e0c2014-09-03 23:22:24 -070071 /**
tomb36046e2014-08-27 00:22:24 -070072 * Returns the port number.
73 *
74 * @return port number
75 */
76 PortNumber number();
77
78 /**
tomca20e0c2014-09-03 23:22:24 -070079 * Indicates whether or not the port is currently up and active.
80 *
81 * @return true if the port is operational
82 */
83 boolean isEnabled();
84
85 /**
Thomas Vachuskad16ce182014-10-29 17:25:29 -070086 * Returns the port type.
tomb36046e2014-08-27 00:22:24 -070087 *
Thomas Vachuskad16ce182014-10-29 17:25:29 -070088 * @return port type
tomb36046e2014-08-27 00:22:24 -070089 */
Thomas Vachuskad16ce182014-10-29 17:25:29 -070090 Type type();
tomb36046e2014-08-27 00:22:24 -070091
Thomas Vachuskad16ce182014-10-29 17:25:29 -070092 /**
93 * Returns the current port speed in Mbps.
94 *
95 * @return current port speed
96 */
97 long portSpeed();
tomb36046e2014-08-27 00:22:24 -070098
Thomas Vachuskad16ce182014-10-29 17:25:29 -070099 // TODO: more attributes?
tomb36046e2014-08-27 00:22:24 -0700100}