Class OpticalPortConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<org.onosproject.net.ConnectPoint>
-
- org.onosproject.net.optical.config.OpticalPortConfig
-
public final class OpticalPortConfig extends org.onosproject.net.config.Config<org.onosproject.net.ConnectPoint>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_KEYConfiguration key forOpticalPortConfig.static java.lang.StringNAMEstatic java.lang.StringPORTstatic java.lang.StringSPEEDstatic java.lang.StringSTATIC_LAMBDAstatic java.lang.StringSTATIC_PORTstatic java.lang.StringTYPE
-
Constructor Summary
Constructors Constructor Description OpticalPortConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValid()java.lang.Stringname()Returns the port name associated with this port configuration.java.lang.StringnumberName()Returns a stringified representation of the port number, configured in some port types without an alphanumeric name as the port name.OpticalPortConfigportName(java.lang.String name)Sets the port name, or updates it if already set.OpticalPortConfigportNumberName(java.lang.Long name)Sets the port name from port number, or updates it if already set.OpticalPortConfigportType(org.onosproject.net.Port.Type type)Sets the port type, or updates it if it's already set.java.util.Optional<java.lang.Integer>speed()Returns the port speed configured for this port.OpticalPortConfigspeed(java.lang.Integer bw)Sets the port speed, or updates it if already set.java.util.Optional<java.lang.Long>staticLambda()Returns the output lambda configured for this port.OpticalPortConfigstaticLambda(java.lang.Long index)Sets the output lambda center frequency, or updates it if already set.java.lang.StringstaticPort()Returns the string-representation of name of the output port.OpticalPortConfigstaticPort(java.lang.String name)Sets the output port name, or updates it if already set.org.onosproject.net.Port.Typetype()Returns the Enum value representing the type of port.-
Methods inherited from class org.onosproject.net.config.Config
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject, toString
-
-
-
-
Field Detail
-
CONFIG_KEY
public static final java.lang.String CONFIG_KEY
Configuration key forOpticalPortConfig.- See Also:
- Constant Field Values
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
PORT
public static final java.lang.String PORT
- See Also:
- Constant Field Values
-
STATIC_PORT
public static final java.lang.String STATIC_PORT
- See Also:
- Constant Field Values
-
STATIC_LAMBDA
public static final java.lang.String STATIC_LAMBDA
- See Also:
- Constant Field Values
-
SPEED
public static final java.lang.String SPEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValid
public boolean isValid()
- Overrides:
isValidin classorg.onosproject.net.config.Config<org.onosproject.net.ConnectPoint>
-
type
public org.onosproject.net.Port.Type type()
Returns the Enum value representing the type of port.- Returns:
- the port type, or null if invalid or unset
-
name
public java.lang.String name()
Returns the port name associated with this port configuration. The Name is an alphanumeric string.- Returns:
- the name of this port, else, an empty string
-
numberName
public java.lang.String numberName()
Returns a stringified representation of the port number, configured in some port types without an alphanumeric name as the port name.- Returns:
- A string representation of the port number
-
staticPort
public java.lang.String staticPort()
Returns the string-representation of name of the output port. This is usually an OMS port for an OCH input ports, or an OCH port for ODU input ports.- Returns:
- the name of this port, else, an empty string
-
staticLambda
public java.util.Optional<java.lang.Long> staticLambda()
Returns the output lambda configured for this port. The lambda value is expressed as a frequency value. If the port type doesn't have a notion of lambdas, this returns an empty Optional.- Returns:
- an Optional that may contain a frequency value.
-
speed
public java.util.Optional<java.lang.Integer> speed()
Returns the port speed configured for this port. If the port doesn't have a notion of speed, this returns an empty Optional.- Returns:
- a port speed value whose default is 0.
-
portType
public OpticalPortConfig portType(org.onosproject.net.Port.Type type)
Sets the port type, or updates it if it's already set. A null argument removes this field.- Parameters:
type- the port type- Returns:
- this OpticalPortConfig instance
-
portName
public OpticalPortConfig portName(java.lang.String name)
Sets the port name, or updates it if already set. A null argument removes this field.- Parameters:
name- the port's name- Returns:
- this OpticalPortConfig instance
-
portNumberName
public OpticalPortConfig portNumberName(java.lang.Long name)
Sets the port name from port number, or updates it if already set. A null argument removes this field.- Parameters:
name- the port number, to be used as name- Returns:
- this OpticalPortConfig instance
-
staticPort
public OpticalPortConfig staticPort(java.lang.String name)
Sets the output port name, or updates it if already set. A null argument removes this field.- Parameters:
name- the output port's name- Returns:
- this OpticalPortConfig instance
-
staticLambda
public OpticalPortConfig staticLambda(java.lang.Long index)
Sets the output lambda center frequency, or updates it if already set. A null argument removes this field.- Parameters:
index- the output lambda- Returns:
- this OpticalPortConfig instance
-
speed
public OpticalPortConfig speed(java.lang.Integer bw)
Sets the port speed, or updates it if already set. A null argument removes this field.- Parameters:
bw- the port bandwidth- Returns:
- this OpticalPortConfig instance
-
-