Class Schema
java.lang.Object
org.apache.curator.framework.schema.Schema
Represents and documents operations allowed for a given path pattern
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaBuilder
Start a builder for the given full path.static SchemaBuilder
Start a builder for the given path pattern.static SchemaBuilder
builderForRecipe
(String parentPath) Start a schema builder for a typical Curator recipe's childrenstatic SchemaBuilder
builderForRecipeParent
(String parentPath) Start a schema builder for a typical Curator recipe's parent nodeboolean
boolean
getName()
getPath()
Return the raw path for this schema.int
hashCode()
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 validvoid
validateDelete
(String path) Validate that this schema allows znode deletionvoid
validateGeneral
(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl) Validate that this schema validates the datavoid
validateWatch
(String path, boolean isWatching) Validate that this schema's watching setting matches
-
Method Details
-
builder
Start a builder for the given full path. Note: full path schemas take precedence over regex path schemas.- Parameters:
path
- full ZNode path. This schema only applies to an exact match- Returns:
- builder
-
builder
Start a builder for the given path pattern.- Parameters:
pathRegex
- regex for the path. This schema applies to any matching paths- Returns:
- builder
-
builderForRecipeParent
Start a schema builder for a typical Curator recipe's parent node- Parameters:
parentPath
- Path to the parent node- Returns:
- builder
-
builderForRecipe
Start a schema builder for a typical Curator recipe's children- Parameters:
parentPath
- Path to the parent node- Returns:
- builder
-
validateDelete
Validate that this schema allows znode deletion- Parameters:
path
- the znode full path- Throws:
SchemaViolation
- if schema does not allow znode deletion
-
validateWatch
Validate that this schema's watching setting matches- Parameters:
path
- the znode full pathisWatching
- true if attempt is being made to watch node- Throws:
SchemaViolation
- if schema's watching setting does not match
-
validateCreate
public 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- Parameters:
mode
- CreateMode being usedpath
- the znode full pathdata
- data being setacl
- the creation acls- Throws:
SchemaViolation
- if schema's create mode setting does not match or data is invalid
-
validateGeneral
Validate that this schema validates the data- Parameters:
path
- the znode full pathdata
- data being setacl
- if creating, the acls otherwise null or empty list- Throws:
SchemaViolation
- if data is invalid
-
getName
-
getRawPath
Return the raw path for this schema. If a full path was used, it is returned. If a regex was used, it is returned- Returns:
- path
-
getMetadata
-
getPathRegex
-
getPath
-
getDocumentation
-
getSchemaValidator
-
getEphemeral
-
getSequential
-
getWatched
-
canBeDeleted
public boolean canBeDeleted() -
equals
-
hashCode
public int hashCode() -
toString
-
toDocumentation
-