Class Interface


  • public class Interface
    extends java.lang.Object
    An Interface maps network configuration information (such as addresses and vlans) to a port in the network.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NO_INTERFACE_NAME  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ConnectPoint connectPoint()
      Retrieves the connection point that this interface maps to.
      boolean equals​(java.lang.Object other)  
      int hashCode()  
      java.util.List<InterfaceIpAddress> ipAddressesList()
      Retrieves a list of IP addresses that are assigned to the interface in the order that they were configured.
      MacAddress mac()
      Retrieves the MAC address that is assigned to the interface.
      java.lang.String name()
      Retrieves the name of the interface.
      java.lang.String toString()  
      VlanId vlan()
      Retrieves the VLAN ID that is assigned to the interface.
      VlanId vlanNative()
      Retrieves the VLAN ID that is assigned to untagged packets on this tagged interface.
      java.util.Set<VlanId> vlanTagged()
      Retrieves the set of VLAN IDs that are allowed on this interface.
      VlanId vlanUntagged()
      Retrieves the VLAN ID that is assigned to untagged packets.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NO_INTERFACE_NAME

        public static final java.lang.String NO_INTERFACE_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • Interface

        public Interface​(java.lang.String name,
                         ConnectPoint connectPoint,
                         java.util.List<InterfaceIpAddress> ipAddresses,
                         MacAddress macAddress,
                         VlanId vlan)
        Creates new Interface with the provided configuration.
        Parameters:
        name - name of the interface
        connectPoint - the connect point this interface maps to
        ipAddresses - list of IP addresses
        macAddress - MAC address
        vlan - VLAN ID
      • Interface

        public Interface​(java.lang.String name,
                         ConnectPoint connectPoint,
                         java.util.List<InterfaceIpAddress> ipAddresses,
                         MacAddress macAddress,
                         VlanId vlan,
                         VlanId vlanUntagged,
                         java.util.Set<VlanId> vlanTagged,
                         VlanId vlanNative)
        Creates new Interface with the provided configuration.
        Parameters:
        name - name of the interface
        connectPoint - the connect point this interface maps to
        ipAddresses - list of IP addresses
        macAddress - MAC address
        vlan - VLAN ID
        vlanUntagged - untagged VLAN. Cannot be used with vlanTagged or vlanNative.
        vlanTagged - tagged VLANs. Cannot be used with vlanUntagged.
        vlanNative - native vLAN. Optional. Can only be used when vlanTagged is specified. Cannot be used with vlanUntagged.
    • Method Detail

      • name

        public java.lang.String name()
        Retrieves the name of the interface.
        Returns:
        name
      • connectPoint

        public ConnectPoint connectPoint()
        Retrieves the connection point that this interface maps to.
        Returns:
        the connection point
      • ipAddressesList

        public java.util.List<InterfaceIpAddress> ipAddressesList()
        Retrieves a list of IP addresses that are assigned to the interface in the order that they were configured.
        Returns:
        list of IP addresses
      • mac

        public MacAddress mac()
        Retrieves the MAC address that is assigned to the interface.
        Returns:
        the MAC address
      • vlan

        public VlanId vlan()
        Retrieves the VLAN ID that is assigned to the interface.
        Returns:
        the VLAN ID
      • vlanUntagged

        public VlanId vlanUntagged()
        Retrieves the VLAN ID that is assigned to untagged packets.
        Returns:
        the VLAN ID
      • vlanTagged

        public java.util.Set<VlanId> vlanTagged()
        Retrieves the set of VLAN IDs that are allowed on this interface.
        Returns:
        the VLAN ID
      • vlanNative

        public VlanId vlanNative()
        Retrieves the VLAN ID that is assigned to untagged packets on this tagged interface.
        Returns:
        the VLAN ID
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object