com.h3c.sdn.misc.net

## Class TopologyClusterDTO

- java.lang.Object
- - com.h3c.sdn.misc.net.TopologyClusterDTO

- All Implemented Interfaces:
    TopologyCluster

      public class TopologyClusterDTO
      extends Object
      implements TopologyCluster

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `id` Cluster id derived as lowest id of nodes in the cluster.
    `protected Map<DataPathId,Set<Link>>` | `links` Map of nodes and associated links of the cluster.
    `protected DataPathId` | `root` DataPathId of the root device in the cluster.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TopologyClusterDTO()` Creates L2 cluster with empty links.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(DataPathId n)` Adds the device to cluster.
    `void` | `addLink(Link l)` Adds the link to cluster.
    `boolean` | `equals(Object obj)` Equality based on just the cluster ID and not the members.
    `static long` | `generateId(DataPathId n)` Generates the long value for given datapath id.
    `int` | `hashCode()`
    `long` | `id()` Retrieves the unique id of this cluster.
    `Map<DataPathId,Set<Link>>` | `links()` Retrieves the map of device dpid and the set of links associated to that dpid.
    `Set<DataPathId>` | `nodes()` Retrieves the set of devicepath ids of the devices comprising this cluster.
    `DataPathId` | `root()` Returns the cluster root datapath id.
    `void` | `setId(long id)` Sets the id to cluster.
    `void` | `setLinks(Map<DataPathId,Set<Link>> links)`
    `void` | `setRoot(DataPathId root)` Sets the root to cluster
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### id

          protected long id

      Cluster id derived as lowest id of nodes in the cluster.

    - #### links

          protected Map<DataPathId,Set<Link>> links

      Map of nodes and associated links of the cluster.

    - #### root

          protected DataPathId root

      DataPathId of the root device in the cluster.

  - ### Constructor Detail

    - #### TopologyClusterDTO

          public TopologyClusterDTO()

      Creates L2 cluster with empty links.

  - ### Method Detail

    - #### id

          public long id()

      Description copied from interface: `TopologyCluster`
      Retrieves the unique id of this cluster.
      Specified by:
        `id` in interface `TopologyCluster`
      Returns:
        the cluster id

    - #### setId

          public void setId(long id)

      Sets the id to cluster.
      Parameters:
        `id` - cluster id to be set

    - #### links

          public Map<DataPathId,Set<Link>> links()

      Description copied from interface: `TopologyCluster`
      Retrieves the map of device dpid and the set of links associated to that dpid.
      Specified by:
        `links` in interface `TopologyCluster`
      Returns:
        the map of dpid and its links

    - #### root

          public DataPathId root()

      Returns the cluster root datapath id.
      Specified by:
        `root` in interface `TopologyCluster`
      Returns:
        Cluster root

    - #### setRoot

          public void setRoot(DataPathId root)

      Sets the root to cluster
      Parameters:
        `root` - cluster root to be set

    - #### add

          public void add(DataPathId n)

      Adds the device to cluster.
      Parameters:
        `n` - Id of the device to be added

    - #### generateId

          public static long generateId(DataPathId n)

      Generates the long value for given datapath id.
      Parameters:
        `n` - datapath id
      Returns:
        long value

    - #### nodes

          public Set<DataPathId> nodes()

      Description copied from interface: `TopologyCluster`
      Retrieves the set of devicepath ids of the devices comprising this cluster.
      Specified by:
        `nodes` in interface `TopologyCluster`
      Returns:
        set of dpid

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### addLink

          public void addLink(Link l)

      Adds the link to cluster.
      Parameters:
        `l` - Link to be added

    - #### equals

          public boolean equals(Object obj)

      Equality based on just the cluster ID and not the members. Lightweight.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `obj` - to check equivalence with
      Returns:
        true if the given Cluster instance has same id as this

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### setLinks

          public void setLinks(Map<DataPathId,Set<Link>> links)

      Parameters:
        `links` - the links to set

Copyright © 2014. All Rights Reserved.