com.h3c.sdn.misc.dsync

## Class SyncUtil

- java.lang.Object
- - com.h3c.sdn.misc.dsync.SyncUtil

-     public class SyncUtil
      extends Object

  General utility that facilitates easier transmission of objects over the HA infrastructure (ZK/Keystore).

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SyncUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `buildRegistry()` Initializes the registry.
    `static SyncUtil` | `instance()` The only way to obtain handle to this utility.
    `static byte[]` | `marshal(SyncObj<?> so)` Marshals a given HA object into its byte form for transmission.
    `static SyncObj<?>` | `unmarshal(Class<?> syncClass, byte[] payload)`

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

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

- - ### Constructor Detail

    - #### SyncUtil

          protected SyncUtil()

  - ### Method Detail

    - #### instance

          public static SyncUtil instance()

      The only way to obtain handle to this utility.
      Returns:
        the singleton instance of this utility.

    - #### unmarshal

          public static SyncObj<?> unmarshal(Class<?> syncClass,
                             byte[] payload)

      Parameters:
        `syncClass` - the class to unmarshal
        `payload` - the bytes to unmarshal
      Returns:
        instance synthesized from the bytes

    - #### marshal

          public static byte[] marshal(SyncObj<?> so)

      Marshals a given HA object into its byte form for transmission.
      Parameters:
        `so` - the Sync object being marshalled
      Returns:
        the flattened bytes.

    - #### buildRegistry

          public void buildRegistry()

      Initializes the registry.

Copyright © 2014. All Rights Reserved.