public class Schema extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Schema.Allowance |
Modifier and Type | Method and Description |
---|---|
static SchemaBuilder |
builder(Pattern pathRegex)
Start a builder for the given path pattern.
|
static SchemaBuilder |
builder(String path)
Start a builder for the given full path.
|
static SchemaBuilder |
builderForRecipe(String parentPath)
Start a schema builder for a typical Curator recipe's children
|
static SchemaBuilder |
builderForRecipeParent(String parentPath)
Start a schema builder for a typical Curator recipe's parent node
|
boolean |
canBeDeleted() |
boolean |
equals(Object o) |
String |
getDocumentation() |
Schema.Allowance |
getEphemeral() |
Map<String,String> |
getMetadata() |
String |
getName() |
String |
getPath() |
Pattern |
getPathRegex() |
String |
getRawPath()
Return the raw path for this schema.
|
SchemaValidator |
getSchemaValidator() |
Schema.Allowance |
getSequential() |
Schema.Allowance |
getWatched() |
int |
hashCode() |
String |
toDocumentation() |
String |
toString() |
void |
validateCreate(org.apache.zookeeper.CreateMode mode,
String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl)
Validate that this schema's create mode setting matches and that the data is valid
|
void |
validateDelete(String path)
Validate that this schema allows znode deletion
|
void |
validateGeneral(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl)
Validate that this schema validates the data
|
void |
validateWatch(String path,
boolean isWatching)
Validate that this schema's watching setting matches
|
public static SchemaBuilder builder(String path)
path
- full ZNode path. This schema only applies to an exact matchpublic static SchemaBuilder builder(Pattern pathRegex)
pathRegex
- regex for the path. This schema applies to any matching pathspublic static SchemaBuilder builderForRecipeParent(String parentPath)
parentPath
- Path to the parent nodepublic static SchemaBuilder builderForRecipe(String parentPath)
parentPath
- Path to the parent nodepublic void validateDelete(String path)
path
- the znode full pathSchemaViolation
- if schema does not allow znode deletionpublic void validateWatch(String path, boolean isWatching)
path
- the znode full pathisWatching
- true if attempt is being made to watch nodeSchemaViolation
- if schema's watching setting does not matchpublic void validateCreate(org.apache.zookeeper.CreateMode mode, String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl)
mode
- CreateMode being usedpath
- the znode full pathdata
- data being setacl
- the creation aclsSchemaViolation
- if schema's create mode setting does not match or data is invalidpublic void validateGeneral(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl)
path
- the znode full pathdata
- data being setacl
- if creating, the acls otherwise null or empty listSchemaViolation
- if data is invalidpublic String getName()
public String getRawPath()
public Pattern getPathRegex()
public String getPath()
public String getDocumentation()
public SchemaValidator getSchemaValidator()
public Schema.Allowance getEphemeral()
public Schema.Allowance getSequential()
public Schema.Allowance getWatched()
public boolean canBeDeleted()
public String toDocumentation()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.