|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.core.ImmutablePort
public class ImmutablePort
An immutable version of an OFPhysical port. In addition, it uses EnumSets instead of integer bitmaps to represent OFPortConfig, OFPortState, and OFPortFeature bitmaps. Port names are stored with the original case but equals() and XXXX use case-insentivie comparisions for port names!! TODO: create a Builder so we can easily construct OFPhysicalPorts TODO: should we verify / ensure that the features make sense, i.e., that currentFeatures IsSubsetOf advertisedFeatures IsSubsetOf supportedFeatures
Nested Class Summary | |
---|---|
static class |
ImmutablePort.Builder
A builder class to create ImmutablePort instances TODO: add methods to remove elements from the EnumSets |
Method Summary | |
---|---|
static ImmutablePort |
create(java.lang.String name,
java.lang.Integer portNumber)
|
boolean |
equals(java.lang.Object obj)
|
static ImmutablePort |
fromOFPhysicalPort(OFPhysicalPort p)
|
java.util.Set<OFPhysicalPort.OFPortFeatures> |
getAdvertisedFeatures()
|
java.util.Set<OFPhysicalPort.OFPortConfig> |
getConfig()
|
java.util.Set<OFPhysicalPort.OFPortFeatures> |
getCurrentFeatures()
|
OFPhysicalPort.OFPortSpeed |
getCurrentPortSpeed()
|
byte[] |
getHardwareAddress()
|
java.lang.String |
getName()
|
java.util.Set<OFPhysicalPort.OFPortFeatures> |
getPeerFeatures()
|
int |
getPortNumber()
|
OFPhysicalPort.OFPortState |
getPortState()
Returns the STP state portion of the OFPortState. |
java.util.Set<OFPhysicalPort.OFPortFeatures> |
getSupportedFeatures()
|
int |
hashCode()
|
static java.util.List<ImmutablePort> |
immutablePortListOf(java.util.Collection<OFPhysicalPort> ports)
Convert a Collection of OFPhysicalPorts to a list of ImmutablePorts. |
static java.util.List<ImmutablePort> |
immutablePortListOf(java.util.List<OFPortDescription> portDescriptions)
Convert a List of OFPortDescription to a list of ImmutablePorts. |
boolean |
isEnabled()
Returns true if the port is up, i.e., it's neither administratively down nor link down. |
boolean |
isLinkDown()
Returns true if the OFPortState indicates the port is down |
static java.util.List<OFPhysicalPort> |
ofPhysicalPortListOf(java.util.Collection<ImmutablePort> ports)
Convert a Collection of ImmutablePort to a list of OFPhyscialPorts. |
java.lang.String |
toBriefString()
Return a brief String describing this port containing the port number and port name |
OFPhysicalPort |
toOFPhysicalPort()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static ImmutablePort fromOFPhysicalPort(OFPhysicalPort p)
public static ImmutablePort create(java.lang.String name, java.lang.Integer portNumber)
public int getPortNumber()
public byte[] getHardwareAddress()
public java.lang.String getName()
public java.util.Set<OFPhysicalPort.OFPortConfig> getConfig()
public boolean isLinkDown()
public OFPhysicalPort.OFPortState getPortState()
public java.util.Set<OFPhysicalPort.OFPortFeatures> getCurrentFeatures()
public java.util.Set<OFPhysicalPort.OFPortFeatures> getAdvertisedFeatures()
public java.util.Set<OFPhysicalPort.OFPortFeatures> getSupportedFeatures()
public java.util.Set<OFPhysicalPort.OFPortFeatures> getPeerFeatures()
public boolean isEnabled()
public OFPhysicalPort.OFPortSpeed getCurrentPortSpeed()
public OFPhysicalPort toOFPhysicalPort()
public java.lang.String toBriefString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.util.List<ImmutablePort> immutablePortListOf(java.util.List<OFPortDescription> portDescriptions)
portDescriptions
-
ImmutablePort
s. This is list is owned by
the caller. The returned list is not thread-safe
java.lang.NullPointerException
- if any OFPhysicalPort or important fields
of any OFPhysicalPort are null
java.lang.IllegalArgumentException
public static java.util.List<ImmutablePort> immutablePortListOf(java.util.Collection<OFPhysicalPort> ports)
ports
-
ImmutablePort
s. This is list is owned by
the caller. The returned list is not thread-safe
java.lang.NullPointerException
- if any OFPhysicalPort or important fields
of any OFPhysicalPort are null
java.lang.IllegalArgumentException
public static java.util.List<OFPhysicalPort> ofPhysicalPortListOf(java.util.Collection<ImmutablePort> ports)
ports
-
OFPhysicalPort
s. This is list is owned by
the caller. The returned list is not thread-safe
java.lang.NullPointerException
- if any ImmutablePort
or the port
list is null
java.lang.IllegalArgumentException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |