Interface InterfaceService

    • Method Detail

      • getInterfaces

        java.util.Set<Interface> getInterfaces()
        Returns the set of all interfaces in the system.
        Returns:
        set of interfaces
      • getInterfaceByName

        Interface getInterfaceByName​(ConnectPoint connectPoint,
                                     java.lang.String name)
        Returns the interface with the given name.
        Parameters:
        connectPoint - connect point of the interface
        name - name of the interface
        Returns:
        interface if it exists, otherwise null
      • getInterfacesByPort

        java.util.Set<Interface> getInterfacesByPort​(ConnectPoint port)
        Returns the set of interfaces configured on the given port.
        Parameters:
        port - connect point
        Returns:
        set of interfaces
      • getInterfacesByIp

        java.util.Set<Interface> getInterfacesByIp​(IpAddress ip)
        Returns the set of interfaces with the given IP address.
        Parameters:
        ip - IP address
        Returns:
        set of interfaces
      • getInterfacesByVlan

        java.util.Set<Interface> getInterfacesByVlan​(VlanId vlan)
        Returns the set of interfaces in the given VLAN.
        Parameters:
        vlan - VLAN ID of the interfaces
        Returns:
        set of interfaces
      • getMatchingInterface

        Interface getMatchingInterface​(IpAddress ip)
        Returns an interface that has an address that is in the same subnet as the given IP address.
        Parameters:
        ip - IP address to find matching subnet interface for
        Returns:
        interface
      • getMatchingInterfaces

        java.util.Set<Interface> getMatchingInterfaces​(IpAddress ip)
        Returns all interfaces that have an address that is in the same subnet as the given IP address.
        Parameters:
        ip - IP address to find matching subnet interface for
        Returns:
        a set of interfaces
      • getUntaggedVlanId

        default VlanId getUntaggedVlanId​(ConnectPoint connectPoint)
        Returns untagged VLAN configured on given connect point.

        Only returns the first match if there are multiple untagged VLAN configured on the connect point.

        Parameters:
        connectPoint - connect point
        Returns:
        untagged VLAN or null if not configured
      • getTaggedVlanId

        default java.util.Set<VlanId> getTaggedVlanId​(ConnectPoint connectPoint)
        Returns tagged VLAN configured on given connect point.

        Returns all matches if there are multiple tagged VLAN configured on the connect point.

        Parameters:
        connectPoint - connect point
        Returns:
        tagged VLAN or empty set if not configured
      • getNativeVlanId

        default VlanId getNativeVlanId​(ConnectPoint connectPoint)
        Returns native VLAN configured on given connect point.

        Only returns the first match if there are multiple native VLAN configured on the connect point.

        Parameters:
        connectPoint - connect point
        Returns:
        native VLAN or null if not configured
      • isConfigured

        default boolean isConfigured​(ConnectPoint connectPoint)
        Returns true if given connectPoint has an IP address or vlan configured on any of its interfaces.
        Parameters:
        connectPoint - the port on a device
        Returns:
        true if connectpoint has a configured interface
      • inUse

        default boolean inUse​(VlanId vlanId)
        Returns true if given vlanId is in use due to configuration on any of the interfaces in the system.
        Parameters:
        vlanId - the vlan id being queried
        Returns:
        true if vlan is configured on any interface