public class MutablePort extends Port implements MutableStructure
Port
.ALL, ANY, CONTROLLER, FLOOD, IN_PORT, LOCAL, MAX, NONE, NORMAL, TABLE
parseErrorCause, version
Constructor and Description |
---|
MutablePort(ProtocolVersion pv)
Constructs a mutable OpenFlow port structure.
|
Modifier and Type | Method and Description |
---|---|
MutablePort |
advertised(Set<PortFeature> advertised)
Sets the port advertised features flags, (may be null); Since 1.0.
|
MutablePort |
config(Set<PortConfig> config)
Sets the port configuration flags, (may be null); Since 1.0.
|
MutablePort |
current(Set<PortFeature> current)
Sets the port current features flags, (may be null); Since 1.0.
|
MutablePort |
currentSpeed(long currentSpeed)
Sets the port current speed (bitrate) in kbps; Since 1.1.
|
MutablePort |
hwAddress(MacAddress hwAddress)
Sets the hardware address for this port; Since 1.0.
|
MutablePort |
maxSpeed(long maxSpeed)
Sets the port maximum speed (bitrate) in kbps; Since 1.1.
|
MutablePort |
name(String name)
Sets the friendly name for this port; Since 1.0.
|
MutablePort |
peer(Set<PortFeature> peer)
Sets the port peer features flags, (may be null); Since 1.0.
|
MutablePort |
portNumber(BigPortNumber portNumber)
Sets the port number for this port; Since 1.0.
|
MutablePort |
state(Set<PortState> state)
Sets the port state flags, (may be null); Since 1.0.
|
MutablePort |
supported(Set<PortFeature> supported)
Sets the port supported features flags, (may be null); Since 1.0.
|
OpenflowStructure |
toImmutable()
Returns an immutable instance of this structure.
|
String |
toString() |
boolean |
writable()
Returns true if this mutable object is still writable.
|
equivalentSpecial, equivalentSpecial, getAdvertised, getBigPortNumber, getConfig, getCurrent, getCurrentSpeed, getHwAddress, getLogicalNumber, getLogicalNumber, getMaxSpeed, getName, getPeer, getPortNumber, getPortNumber, getState, getSupported, isBlocked, isEnabled, isLinkUp, isStandardPort, logicalName, portNumberToString, portNumberToString, portNumberToString, toDebugString, toDebugString, validate, validatePortValue
getVersion, hex, hex, incomplete, parseErrorCause
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getVersion, toDebugString
public MutablePort(ProtocolVersion pv)
pv
- the protocol versionpublic OpenflowStructure toImmutable()
MutableStructure
It is expected that the reference to this mutable structure will be
dropped. Note that all method calls invoked on a
MutableStructure
after toImmutable()
has been invoked
will result in an InvalidMutableException
being thrown.
toImmutable
in interface MutableStructure
public boolean writable()
MutableObject
#toImmutable()
method (defined on a sub-interface)
has not yet been invoked.writable
in interface MutableObject
public MutablePort portNumber(BigPortNumber portNumber)
Note that in 1.0, port numbers are u16.
portNumber
- the port numberInvalidMutableException
- if this instance is no longer writableNullPointerException
- if the argument is nullIllegalArgumentException
- if the port number is invalidpublic MutablePort hwAddress(MacAddress hwAddress)
hwAddress
- the hardware addressInvalidMutableException
- if this instance is no longer writableNullPointerException
- if the argument is nullpublic MutablePort name(String name)
name
- the friendly nameInvalidMutableException
- if this instance is no longer writableNullPointerException
- if name is nullIllegalArgumentException
- if name length is >15public MutablePort config(Set<PortConfig> config)
config
- the port configuration flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort state(Set<PortState> state)
state
- the port state flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort current(Set<PortFeature> current)
current
- the port current features flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort advertised(Set<PortFeature> advertised)
advertised
- the port advertised features flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort supported(Set<PortFeature> supported)
supported
- the port supported features flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort peer(Set<PortFeature> peer)
peer
- the port peer features flagsInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if an unsupported flag is presentpublic MutablePort currentSpeed(long currentSpeed)
The number should be rounded to match common usage. For example
an optical 10 Gb Ethernet port should have this field set to
10000000
(instead of 10312500
), and an
OC-192 port should have this field set to 10000000
(instead of 9953280
).
currentSpeed
- the current speedInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if protocol version is < 1.1IllegalArgumentException
- if value is not u32public MutablePort maxSpeed(long maxSpeed)
The number should be rounded to match common usage. For example
an optical 10 Gb Ethernet port should have this field set to
10000000
(instead of 10312500
), and an
OC-192 port should have this field set to 10000000
(instead of 9953280
).
maxSpeed
- the maximum speedInvalidMutableException
- if this instance is no longer writableVersionMismatchException
- if protocol version is < 1.1IllegalArgumentException
- if value is not u32Copyright © 2015. All Rights Reserved.