public interface ModelSpec<T> extends Resolvable
Modifier and Type | Field and Description |
---|---|
static Set<CreateOption> |
defaultCreateOptions |
static Set<DeleteOption> |
defaultDeleteOptions |
Modifier and Type | Method and Description |
---|---|
List<org.apache.zookeeper.data.ACL> |
aclList()
Return the model's ACL list
|
static <T> ModelSpecBuilder<T> |
builder(ModelSerializer<T> serializer)
Start a new ModelSpecBuilder for the given serializer.
|
static <T> ModelSpecBuilder<T> |
builder(ZPath path,
ModelSerializer<T> serializer)
Start a new ModelSpecBuilder for the given path and serializer.
|
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
|
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
|
long |
ttl()
Return the TTL to use or -1
|
ModelSpec<T> |
withPath(ZPath path)
Return a new CuratorModel instance with all the same options but using the given path.
|
static final Set<CreateOption> defaultCreateOptions
static final Set<DeleteOption> defaultDeleteOptions
static <T> ModelSpecBuilder<T> builder(ZPath path, ModelSerializer<T> serializer)
defaultCreateOptions
and defaultDeleteOptions
, but you can change these
with builder methods.path
- path to modelserializer
- the model's serializerstatic <T> ModelSpecBuilder<T> builder(ModelSerializer<T> serializer)
defaultCreateOptions
and defaultDeleteOptions
, but you can change these
with builder methods. You must set a path before calling ModelSpecBuilder.build()
serializer
- the model's serializerModelSpec<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. 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()
.
child
- child node.ModelSpec<T> parent()
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()
.
ModelSpec<T> withPath(ZPath path)
path
- new pathModelSpec<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
The replacement is the toString()
value of the parameter object or,
if the object implements NodeName
,
the value of nodeName()
.
resolved
in interface Resolvable
parameters
- list of replacements. Must have be the same length as the number of
parameter nodes in the pathModelSpec<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
The replacement is the toString()
value of the parameter object or,
if the object implements NodeName
,
the value of nodeName()
.
resolved
in interface Resolvable
parameters
- list of replacements. Must have be the same length as the number of
parameter nodes in the pathZPath path()
ModelSerializer<T> serializer()
org.apache.zookeeper.CreateMode createMode()
List<org.apache.zookeeper.data.ACL> aclList()
Set<CreateOption> createOptions()
Set<DeleteOption> deleteOptions()
long ttl()
Schema schema()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.