Class Interface


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

      • Interface

        public Interface​(String name,
                         ConnectPoint connectPoint,
                         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​(String name,
                         ConnectPoint connectPoint,
                         List<InterfaceIpAddress> ipAddresses,
                         MacAddress macAddress,
                         VlanId vlan,
                         VlanId vlanUntagged,
                         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 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 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 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object