Class OpticalPortConfig


  • public final class OpticalPortConfig
    extends org.onosproject.net.config.Config<org.onosproject.net.ConnectPoint>
    Configurations for an optical port on a device.

    Example:

     "ports": {
       "(device Id)/(port number)": {
         "optical": {
                  "type": "OCH",
                  "speed": 0,
                  "port": 10
                  ...
         }
       }
     }
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.onosproject.net.config.Config

        org.onosproject.net.config.Config.FieldPresence
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CONFIG_KEY
      Configuration key for OpticalPortConfig.
      static java.lang.String NAME  
      static java.lang.String PORT  
      static java.lang.String SPEED  
      static java.lang.String STATIC_LAMBDA  
      static java.lang.String STATIC_PORT  
      static java.lang.String TYPE  
      • Fields inherited from class org.onosproject.net.config.Config

        array, delegate, key, mapper, node, object, subject
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isValid()  
      java.lang.String name()
      Returns the port name associated with this port configuration.
      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.
      OpticalPortConfig portName​(java.lang.String name)
      Sets the port name, or updates it if already set.
      OpticalPortConfig portNumberName​(java.lang.Long name)
      Sets the port name from port number, or updates it if already set.
      OpticalPortConfig portType​(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.
      OpticalPortConfig speed​(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.
      OpticalPortConfig staticLambda​(java.lang.Long index)
      Sets the output lambda center frequency, or updates it if already set.
      java.lang.String staticPort()
      Returns the string-representation of name of the output port.
      OpticalPortConfig staticPort​(java.lang.String name)
      Sets the output port name, or updates it if already set.
      org.onosproject.net.Port.Type type()
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • OpticalPortConfig

        public OpticalPortConfig()
    • Method Detail

      • isValid

        public boolean isValid()
        Overrides:
        isValid in class org.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