com.h3c.dist.sync

## Class SyncServiceUtil

- java.lang.Object
- - com.h3c.dist.sync.SyncServiceUtil

-     public class SyncServiceUtil
      extends Object

  Distributed services utility function class

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SyncServiceUtil.SortByNodePath`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SyncServiceUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static List<SyncServiceMultiOpResult>` | `createPaths(SyncService svc, List<SyncServiceMultiOp> opList)` Attempt to create the paths present in the list.
    `static void` | `deletePath(SyncService svc, SyncServiceNodePath path, boolean deleteParent)` Delete a path hierarchy.
    `static void` | `deletePaths(SyncService svc, List<SyncServiceNodePath> pathList, boolean deleteParent)` Delete a set of path hierarchies.
    `static SyncServiceNodePath` | `skipTailNodeFromPath(SyncServiceNodePath path)`

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

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

- - ### Constructor Detail

    - #### SyncServiceUtil

          public SyncServiceUtil()

  - ### Method Detail

    - #### skipTailNodeFromPath

          public static SyncServiceNodePath skipTailNodeFromPath(SyncServiceNodePath path)

    - #### createPaths

          public static List<SyncServiceMultiOpResult> createPaths(SyncService svc,
                                                   List<SyncServiceMultiOp> opList)
                                                            throws ServiceNotAvailableException,
                                                                   SyncServiceException.NodeExistsException,
                                                                   InterruptedException

      Attempt to create the paths present in the list. In case of a node not found exception, add the missing path to the list and attempt to create all the paths recursively.
      Parameters:
        `svc` - sync service object
        `opList` - List of Multi operations
      Returns:
        opResultList result of sync service operation set
      Throws:
        `ServiceNotAvailableException` - Sync service is not UP
        `SyncServiceException.NodeExistsException` - Node exists exception
        `InterruptedException` - Operation interrupted exception

    - #### deletePath

          public static void deletePath(SyncService svc,
                        SyncServiceNodePath path,
                        boolean deleteParent)
                                 throws ServiceNotAvailableException,
                                        InterruptedException

      Delete a path hierarchy. Ex: /locks/app/key1/r-001, the API attempts to delete entire hierarchy unless there exists extra children for the nodes.
      Parameters:
        `svc` - sync service
        `path` - path to be deleted
        `deleteParent` - should we delete the parent node of the hierarchy
      Throws:
        `InterruptedException` - Operation interrupted exception
        `ServiceNotAvailableException` - Sync service is not Up

    - #### deletePaths

          public static void deletePaths(SyncService svc,
                         List<SyncServiceNodePath> pathList,
                         boolean deleteParent)
                                  throws ServiceNotAvailableException,
                                         InterruptedException

      Delete a set of path hierarchies.
      Parameters:
        `svc` - sync service handle
        `pathList` - list of the paths to be deleted
        `deleteParent` - should we delete the parent node of the hierarchies
      Throws:
        `InterruptedException` - Operation interrupted exception
        `ServiceNotAvailableException` - Sync service not Up

Copyright © 2014. All Rights Reserved.