com.h3c.sdn.topology

## Interface TopologyService

-     public interface TopologyService

  Network Service component which provides topology information of the control domain. It also facilitates shortest path traversals through the control domain by way of computing low cost next hops between any two elements in the control domain.

  Services from this component could be used for example by an application to configure preemptive or reactive flows through the control domain, or trace the packet flow through the control domain elements.

  Topology Service also provides a mechanism for interested controller entities to get notified whenever there is a topology re-computation event. This is achieved by leverage of the `addListener` API. Such entities should also take care of notifying Topology Service of their disinterest to such events by invoking `removeListener(com.h3c.sdn.topology.TopologyListener)`. It is left to the implementation of this service to define at what point it determines a recompute event has occurred.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(TopologyListener listener)` Provides ability for interested components to get notified whenever Topology is recomputed.
    `void` | `addPortlinkabnormal(DataPathId dpId, BigPortNumber portNumber)` add port with link abnormal state
    `void` | `clearPortlinkabnormal(DataPathId dpId, BigPortNumber portNumber)` delete port with link abnormal state
    `TopologyCluster` | `cluster(DataPathId switchDpid)` Retrieves the cluster to which this control domain element is associated to as determined by Topology Service.
    `List<TopologyCluster>` | `clusters()` Provides enumeration of the grouping of control domain elements into clusters of strongly connected nodes, as determined by Topology Service.
    `L2Path` | `createL2RoutePath(DataPathId srcDpid, DataPathId dstDpid, List<Link> paths)` Change the Class L2Path to Class L2RoutePath for PathDaemon to use get/remove/contains, etc..
    `List<L2Path>` | `ecmpPath(DataPathId device, DataPathId device2)`
    `Map<DataPathId,Link>` | `getDestinationTree(DataPathId pktSrcDpid)`
    `Set<BigPortNumber>` | `getDeviceConnectionPorts(DataPathId dpid)` Return all ports emanating from the given datapath
    `boolean` | `isConnectionPoint(DataPathId switchDpid, BigPortNumber portId)` Indicates if the given port, belonging to the specified node is participating in a interconnect link
    `boolean` | `isPortlinkabnormal(DataPathId dpId, BigPortNumber portNumber)` get port link abnormal state
    `boolean` | `participateInBroadcast(DataPathId switchDpid, BigPortNumber portId)` Indicates if the given switch-port pair can participate in flood action.
    `L2Path` | `path(DataPathId source, DataPathId dest)` Determines control domain elements that need to be traversed for reaching destination node from a source node.
    `boolean` | `pathExists(DataPathId source, DataPathId dest)` Verifies if a L2 path exists between given source and destination switch.
    `Set<BigPortNumber>` | `ports(DataPathId switchDpid)` List of ports learned by Topology Service for a given switch node.
    `void` | `removeListener(TopologyListener listener)` Provides a way for the components to inform Topology Service that it is no more interested in getting notified of topology recompute events.
    `Map<DataPathId,Link>` | `tree(long clusterId)` Represents set of nodes and the link which it contributes to the tree for the given cluster.

- - ### Method Detail

    - #### pathExists

          boolean pathExists(DataPathId source,
                           DataPathId dest)

      Verifies if a L2 path exists between given source and destination switch.
      Parameters:
        `source` - datapathId of the source node
        `dest` - datapathId of the destination node
      Returns:
        true if there exists a route between source and dest

    - #### path

          L2Path path(DataPathId source,
                    DataPathId dest)

      Determines control domain elements that need to be traversed for reaching destination node from a source node. This is expected to contain every node falls in the shortest path between source and dest within the same cluster.
      Parameters:
        `source` - datapathId of the source node
        `dest` - datapathId of the destination node
      Returns:
        L2Path which encapsulates list of paths to be taken
      See Also:
        `L2Path`

    - #### ports

          Set<BigPortNumber> ports(DataPathId switchDpid)

      List of ports learned by Topology Service for a given switch node. Note that the returned set of ports for the given node could be just a sub-set of the actual set of ports present in the switch. Topology service just learns about those which are participating in a link.
      Parameters:
        `switchDpid` - dpid of the switch whose ports are required
      Returns:
        unique list of port numbers (ifAlias/ifIndex) as detected by Topology

    - #### isConnectionPoint

          boolean isConnectionPoint(DataPathId switchDpid,
                                  BigPortNumber portId)

      Indicates if the given port, belonging to the specified node is participating in a interconnect link
      Parameters:
        `switchDpid` - pid of the switch which owns the port
        `portId` - port number(ifAlias/ifIndex) of the node
      Returns:
        true if this port is a participant of a Link element, false otherwise

    - #### getDeviceConnectionPorts

          Set<BigPortNumber> getDeviceConnectionPorts(DataPathId dpid)

      Return all ports emanating from the given datapath
      Parameters:
        `dpid` - pid of specified switch
      Returns:
        the set of BigPortNumber for the specified datapath

    - #### clusters

          List<TopologyCluster> clusters()

      Provides enumeration of the grouping of control domain elements into clusters of strongly connected nodes, as determined by Topology Service.
      Returns:
        List of Clusters which in turn is an group of directly linked devices)
      See Also:
        `TopologyCluster`

    - #### cluster

          TopologyCluster cluster(DataPathId switchDpid)

      Retrieves the cluster to which this control domain element is associated to as determined by Topology Service.
      Parameters:
        `switchDpid` - node whose cluster information is being requested
      Returns:
        TopologyCluster representing the cluster

    - #### participateInBroadcast

          boolean participateInBroadcast(DataPathId switchDpid,
                                       BigPortNumber portId)

      Indicates if the given switch-port pair can participate in flood action.
      Parameters:
        `switchDpid` - of the device to check
        `portId` - of the port belonging to the given switch
      Returns:
        true if this sw:port pair can participate in broadcast

    - #### tree

          Map<DataPathId,Link> tree(long clusterId)

      Represents set of nodes and the link which it contributes to the tree for the given cluster.
      Parameters:
        `clusterId` - id of the cluster whose tree is being requested
      Returns:
        Map of node and its contributing link

    - #### addListener

          void addListener(TopologyListener listener)

      Provides ability for interested components to get notified whenever Topology is recomputed.
      Parameters:
        `listener` - the implementation of TopologyListener interface

    - #### removeListener

          void removeListener(TopologyListener listener)

      Provides a way for the components to inform Topology Service that it is no more interested in getting notified of topology recompute events.
      Parameters:
        `listener` - the implementation of TopologyListener interface

    - #### getDestinationTree

          Map<DataPathId,Link> getDestinationTree(DataPathId pktSrcDpid)

    - #### ecmpPath

          List<L2Path> ecmpPath(DataPathId device,
                              DataPathId device2)

    - #### isPortlinkabnormal

          boolean isPortlinkabnormal(DataPathId dpId,
                                   BigPortNumber portNumber)

      get port link abnormal state
      Parameters:
        `dpId` - device id
        `portNumber` - port id

    - #### clearPortlinkabnormal

          void clearPortlinkabnormal(DataPathId dpId,
                                   BigPortNumber portNumber)

      delete port with link abnormal state
      Parameters:
        `dpId` - device id
        `portNumber` - port id

    - #### addPortlinkabnormal

          void addPortlinkabnormal(DataPathId dpId,
                                 BigPortNumber portNumber)

      add port with link abnormal state
      Parameters:
        `dpId` - device id
        `portNumber` - port id

    - #### createL2RoutePath

          L2Path createL2RoutePath(DataPathId srcDpid,
                                 DataPathId dstDpid,
                                 List<Link> paths)

      Change the Class L2Path to Class L2RoutePath for PathDaemon to use get/remove/contains, etc..
      Parameters:
        `DataPathId` - src device id
        `DataPathId` - dst device id
        `List` - paths

Copyright © 2014. All Rights Reserved.