public class ModelSpecImpl<T> extends Object implements ModelSpec<T>, SchemaValidator
defaultCreateOptions, defaultDeleteOptions
Constructor and Description |
---|
ModelSpecImpl(ZPath path,
ModelSerializer<T> serializer,
org.apache.zookeeper.CreateMode createMode,
List<org.apache.zookeeper.data.ACL> aclList,
Set<CreateOption> createOptions,
Set<DeleteOption> deleteOptions,
long ttl) |
Modifier and Type | Method and Description |
---|---|
List<org.apache.zookeeper.data.ACL> |
aclList()
Return the model's ACL list
|
ModelSpec<T> |
child(Object child)
Return a new CuratorModel instance with all the same options but applying to the given child node of this CuratorModel's
path.
|
org.apache.zookeeper.CreateMode |
createMode()
Return the model's create mode
|
Set<CreateOption> |
createOptions()
Return the model's create options
|
Set<DeleteOption> |
deleteOptions()
Return the model's delete options
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isValid(Schema schema,
String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl) |
ModelSpec<T> |
parent()
Return a new CuratorModel instance with all the same options but applying to the parent node of this CuratorModel's
path.
|
ZPath |
path()
Return the model's path
|
ModelSpec<T> |
resolved(List<Object> parameters)
Return a new CuratorModel instance with all the same options but using a resolved
path by calling
ZPath.resolved(java.util.List)
using the given parameters |
ModelSpec<T> |
resolved(Object... parameters)
Return a new CuratorModel instance with all the same options but using a resolved
path by calling
ZPath.resolved(Object...)
using the given parameters |
Schema |
schema()
Return a Curator schema that validates ZNodes at this model's
path using this model's values
|
ModelSerializer<T> |
serializer()
Return the model's serializer
|
String |
toString() |
long |
ttl()
Return the TTL to use or -1
|
ModelSpec<T> |
withPath(ZPath newPath)
Return a new CuratorModel instance with all the same options but using the given path.
|
public ModelSpecImpl(ZPath path, ModelSerializer<T> serializer, org.apache.zookeeper.CreateMode createMode, List<org.apache.zookeeper.data.ACL> aclList, Set<CreateOption> createOptions, Set<DeleteOption> deleteOptions, long ttl)
public ModelSpec<T> child(Object child)
ModelSpec
Return a new CuratorModel instance with all the same options but applying to the given child node of this CuratorModel's
path. E.g. if this CuratorModel instance applies to "/a/b", calling modeled.at("c")
returns an instance that applies to
"/a/b/c".
The replacement is the toString()
value of child or,
if it implements NodeName
,
the value of nodeName()
.
public ModelSpec<T> parent()
ModelSpec
Return a new CuratorModel instance with all the same options but applying to the parent node of this CuratorModel's
path. E.g. if this CuratorModel instance applies to "/a/b/c", calling modeled.parent()
returns an instance that applies to
"/a/b".
The replacement is the toString()
value of child or,
if it implements NodeName
,
the value of nodeName()
.
public ModelSpec<T> resolved(Object... parameters)
ModelSpec
Return a new CuratorModel instance with all the same options but using a resolved
path by calling ZPath.resolved(Object...)
using the given parameters
The replacement is the toString()
value of the parameter object or,
if the object implements NodeName
,
the value of nodeName()
.
resolved
in interface ModelSpec<T>
resolved
in interface Resolvable
parameters
- list of replacements. Must have be the same length as the number of
parameter nodes in the pathpublic ModelSpec<T> resolved(List<Object> parameters)
ModelSpec
Return a new CuratorModel instance with all the same options but using a resolved
path by calling ZPath.resolved(java.util.List)
using the given parameters
The replacement is the toString()
value of the parameter object or,
if the object implements NodeName
,
the value of nodeName()
.
resolved
in interface ModelSpec<T>
resolved
in interface Resolvable
parameters
- list of replacements. Must have be the same length as the number of
parameter nodes in the pathpublic ModelSpec<T> withPath(ZPath newPath)
ModelSpec
public ModelSerializer<T> serializer()
ModelSpec
serializer
in interface ModelSpec<T>
public org.apache.zookeeper.CreateMode createMode()
ModelSpec
createMode
in interface ModelSpec<T>
public List<org.apache.zookeeper.data.ACL> aclList()
ModelSpec
public Set<CreateOption> createOptions()
ModelSpec
createOptions
in interface ModelSpec<T>
public Set<DeleteOption> deleteOptions()
ModelSpec
deleteOptions
in interface ModelSpec<T>
public long ttl()
ModelSpec
public Schema schema()
ModelSpec
public boolean isValid(Schema schema, String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl)
isValid
in interface SchemaValidator
schema
- the schema being validatedpath
- the path being operated ondata
- data or nullacl
- acls or nullCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.