public final class ProtectedUtils extends Object
CreateBuilderMain.withProtection()
Modifier and Type | Method and Description |
---|---|
static Optional<String> |
extractProtectedId(String znodeName)
Extracts protectedId in case the provided name is protected
|
static String |
getProtectedPrefix(String protectedId)
Provides a prefix to be prepended to a ZNode name when protected.
|
static boolean |
isProtectedZNode(String znodeName)
Utility method to determine if a given ZNode name starts with Curator's generated protected prefix.
|
static String |
normalize(String znodeName)
Utility method to remove Curator's generated protected prefix if present
|
static String |
normalizePath(String path)
Utility method to provide a path removing Curator's generated protected prefix if present in the ZNode name
|
static String |
toProtectedZNode(String znodeName,
String protectedId)
Converts a given ZNode name to protected format
|
static String |
toProtectedZNodePath(String path,
String protectedId)
Converts a given path to protected format
|
public static String getProtectedPrefix(String protectedId)
protectedId
- canonical text representation of a UUIDpublic static boolean isProtectedZNode(String znodeName)
znodeName
- ZNode nametrue
if the given ZNode name starts with Curator's generated protected prefixpublic static String normalize(String znodeName)
znodeName
- ZNode namepublic static String normalizePath(String path)
path
- ZNode pathpublic static Optional<String> extractProtectedId(String znodeName)
znodeName
- name of the ZNodeOptional#empty()
public static String toProtectedZNode(String znodeName, String protectedId)
znodeName
- name to be converted (e.g. 'name1')protectedId
- UUID canonical text representation used in protection mode (e.g. '53345f98-9423-4e0c-a7b5-9f819e3ec2e1')null
public static String toProtectedZNodePath(String path, String protectedId)
path
- complete path to be converted (e.g. '/root/path1')protectedId
- UUID canonical text representation used in protection mode (e.g. '53345f98-9423-4e0c-a7b5-9f819e3ec2e1')null
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.