com.h3c.sdn.linkdisco

## Interface LinkService

-     public interface LinkService

  Provides link related services to external applications.

  Services of this interface provide the ability to:

  - enumerate all links
  - enumerate links involving specific device
  - manage ports on which LLDP exchange needs to be suppressed
  - subscribe as listener to link updates

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(LinkListener listener)` Adds the specified link update listener.
    `void` | `addToSuppressLLDPs(DataPathId dpid, BigPortNumber port)` Adds the given <device,port> tuple to the list of suppressed ports.
    `Set<Link>` | `getAllLinks()` Returns all links discovered in the network.
    `Set<Link>` | `getDeviceLinks(DataPathId dpid)` Returns all links emanating from the given datapath.
    `Set<ConnectionPoint>` | `getDevicePoints(DataPathId dpid)`
    `List<DpSuppressedPorts>` | `getDpSuppressedPorts()` Returns all <device,port> `suppressed ports` tuples where LLDP exchange is suppressed.
    `Set<ConnectionPoint>` | `getSuppressLLDPsInfo()` Returns all <device,port> `connection point` tuples where LLDP exchange is suppressed.
    `boolean` | `isInfraPort(ConnectionPoint cp)` Check if the given connection point is a infrastructure connection point.
    `void` | `removeFromSuppressLLDPs(DataPathId dpid, BigPortNumber port)` Removes the given <device,port> tuple from the list of suppressed ports which were previously added.
    `void` | `removeListener(LinkListener listener)` Removes the specified link update listener.

- - ### Method Detail

    - #### getAllLinks

          Set<Link> getAllLinks()

      Returns all links discovered in the network. Note that since links are directional with respect to source and destination every full-duplex link will be represented by two links with opposite source and destination pairs.
      Returns:
        the set of links

    - #### getDeviceLinks

          Set<Link> getDeviceLinks(DataPathId dpid)

      Returns all links emanating from the given datapath. Note that since links are directional with respect to source and destination every full-duplex link will be represented by two links with opposite source and destination pairs.
      Parameters:
        `dpid` - the datapath id
      Returns:
        the set of links for the specified datapath

    - #### isInfraPort

          boolean isInfraPort(ConnectionPoint cp)

      Check if the given connection point is a infrastructure connection point.
      Parameters:
        `cp` - the connection point
      Returns:
        true if its a infrastructure connection point else false

    - #### getDevicePoints

          Set<ConnectionPoint> getDevicePoints(DataPathId dpid)

    - #### getSuppressLLDPsInfo

          Set<ConnectionPoint> getSuppressLLDPsInfo()

      Returns all <device,port> `connection point` tuples where LLDP exchange is suppressed.

      Consumers of this API can inspect the ports on which LLDP exchange was withheld and subsequently the corresponding links were not learnt.

      Returns:
        the set of connection points

    - #### getDpSuppressedPorts

          List<DpSuppressedPorts> getDpSuppressedPorts()

      Returns all <device,port> `suppressed ports` tuples where LLDP exchange is suppressed.

      Consumers of this API can inspect the ports on which LLDP exchange was withheld and subsequently the corresponding links were not learnt.

      Returns:
        the set of dp suppressed ports

    - #### addToSuppressLLDPs

          void addToSuppressLLDPs(DataPathId dpid,
                                BigPortNumber port)

      Adds the given <device,port> tuple to the list of suppressed ports.

      Consumers of this API can instruct the ports on which LLDP exchange needs to be withheld and the corresponding link can be ignored.

      Parameters:
        `dpid` - the target datapath
        `port` - the switch port number
      Throws:
        `NullPointerException` - if datapath ID or port is null

    - #### removeFromSuppressLLDPs

          void removeFromSuppressLLDPs(DataPathId dpid,
                                     BigPortNumber port)

      Removes the given <device,port> tuple from the list of suppressed ports which were previously added.

      Consumers of this API can instruct the ports on which LLDP exchange needs to be revoked and the corresponding link needs to be learnt.

      Parameters:
        `dpid` - the controller learnt switch or datapath
        `port` - the switch port number
      Throws:
        `NullPointerException` - if datapath ID or port is null

    - #### addListener

          void addListener(LinkListener listener)

      Adds the specified link update listener.
      Parameters:
        `listener` - the listener to be added
      Throws:
        `NullPointerException` - if the listener is null

    - #### removeListener

          void removeListener(LinkListener listener)

      Removes the specified link update listener.
      Parameters:
        `listener` - the listener to be removed
      Throws:
        `NullPointerException` - if the listener is null

Copyright © 2014. All Rights Reserved.