com.h3c.sdn.misc.dsync.net

## Class TopologyClusterSyncObj

- java.lang.Object
- - com.h3c.sdn.misc.dsync.AbstractSyncObj<TopologyClusterSyncObj>
  - - com.h3c.sdn.misc.dsync.net.TopologyClusterSyncObj

- All Implemented Interfaces:
    TopologyCluster, SyncObj<TopologyClusterSyncObj>, Serializable

      public class TopologyClusterSyncObj
      extends AbstractSyncObj<TopologyClusterSyncObj>
      implements TopologyCluster

  A sync object for encoding and decoding `TopologyClusterDTO` objects. for high availability.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ROOT`
    `static String` | `ROOTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TopologyClusterSyncObj()`
    `TopologyClusterSyncObj(long id, Map<DataPathId,Set<Link>> links, DataPathId root)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SyncObj` | `decode(com.fasterxml.jackson.databind.node.ObjectNode jsonNode)` Convert a given raw ObjectNode to required SyncObject.
    `com.fasterxml.jackson.databind.node.ObjectNode` | `encode(com.fasterxml.jackson.databind.node.ObjectNode rawNode)` Stuffs an empty ObjectNode with desired form of the SyncObj.
    `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()` Retrieves the set of devicepath ids of the devices comprising this cluster.

    - ### Methods inherited from class com.h3c.sdn.misc.dsync.AbstractSyncObj

      `isNull, mapper, marshal, unmarshal`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ROOT

          public static final String ROOT

      See Also:
        Constant Field Values

    - #### ROOTS

          public static final String ROOTS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TopologyClusterSyncObj

          public TopologyClusterSyncObj()

    - #### TopologyClusterSyncObj

          public TopologyClusterSyncObj(long id,
                                Map<DataPathId,Set<Link>> links,
                                DataPathId root)

  - ### Method Detail

    - #### encode

          public com.fasterxml.jackson.databind.node.ObjectNode encode(com.fasterxml.jackson.databind.node.ObjectNode rawNode)

      Description copied from class: `AbstractSyncObj`
      Stuffs an empty ObjectNode with desired form of the SyncObj. at this point.
      Specified by:
        `encode` in class `AbstractSyncObj<TopologyClusterSyncObj>`
      Parameters:
        `rawNode` - the empty ObjectNode that needs to be built on.
      Returns:
        the fully dressed ObjectNode that represents the SyncObj.

    - #### decode

          public SyncObj decode(com.fasterxml.jackson.databind.node.ObjectNode jsonNode)

      Description copied from class: `AbstractSyncObj`
      Convert a given raw ObjectNode to required SyncObject.
      Specified by:
        `decode` in class `AbstractSyncObj<TopologyClusterSyncObj>`
      Parameters:
        `jsonNode` - the raw ObjectNode synthesized from the bytes retrieved from the HA infrastructure.
      Returns:
        the decoded SyncObject

    - #### 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

    - #### 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

    - #### 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

    - #### root

          public DataPathId root()

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

Copyright © 2014. All Rights Reserved.