Class ModelSpecImpl<T>
- All Implemented Interfaces:
SchemaValidator
,ModelSpec<T>
,Resolvable
-
Field Summary
Fields inherited from interface org.apache.curator.x.async.modeled.ModelSpec
defaultCreateOptions, defaultDeleteOptions
-
Constructor Summary
ConstructorDescriptionModelSpecImpl
(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) -
Method Summary
Modifier and TypeMethodDescriptionList
<org.apache.zookeeper.data.ACL> aclList()
Return the model's ACL listReturn 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
Return the model's create modeReturn the model's create optionsReturn the model's delete optionsboolean
int
hashCode()
boolean
parent()
Return a new CuratorModel instance with all the same options but applying to the parent node of this CuratorModel's path.path()
Return the model's pathReturn a new CuratorModel instance with all the same options but using a resolved path by callingZPath.resolved(Object...)
using the given parametersReturn a new CuratorModel instance with all the same options but using a resolved path by callingZPath.resolved(java.util.List)
using the given parametersschema()
Return a Curator schema that validates ZNodes at this model's path using this model's valuesReturn the model's serializertoString()
long
ttl()
Return the TTL to use or -1Return a new CuratorModel instance with all the same options but using the given path.
-
Constructor Details
-
ModelSpecImpl
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)
-
-
Method Details
-
child
Description copied from interface: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 implementsNodeName
, the value ofnodeName()
. -
parent
Description copied from interface: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 implementsNodeName
, the value ofnodeName()
. -
resolved
Description copied from interface:ModelSpec
Return a new CuratorModel instance with all the same options but using a resolved path by calling
ZPath.resolved(Object...)
using the given parametersThe replacement is the
toString()
value of the parameter object or, if the object implementsNodeName
, the value ofnodeName()
.- Specified by:
resolved
in interfaceModelSpec<T>
- Specified by:
resolved
in interfaceResolvable
- Parameters:
parameters
- list of replacements. Must have be the same length as the number of parameter nodes in the path- Returns:
- new resolved ModelSpec
-
resolved
Description copied from interface: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 parametersThe replacement is the
toString()
value of the parameter object or, if the object implementsNodeName
, the value ofnodeName()
.- Specified by:
resolved
in interfaceModelSpec<T>
- Specified by:
resolved
in interfaceResolvable
- Parameters:
parameters
- list of replacements. Must have be the same length as the number of parameter nodes in the path- Returns:
- new resolved ModelSpec
-
withPath
Description copied from interface:ModelSpec
Return a new CuratorModel instance with all the same options but using the given path. -
path
Description copied from interface:ModelSpec
Return the model's path -
serializer
Description copied from interface:ModelSpec
Return the model's serializer- Specified by:
serializer
in interfaceModelSpec<T>
- Returns:
- serializer
-
createMode
public org.apache.zookeeper.CreateMode createMode()Description copied from interface:ModelSpec
Return the model's create mode- Specified by:
createMode
in interfaceModelSpec<T>
- Returns:
- create mode
-
aclList
Description copied from interface:ModelSpec
Return the model's ACL list -
createOptions
Description copied from interface:ModelSpec
Return the model's create options- Specified by:
createOptions
in interfaceModelSpec<T>
- Returns:
- create options
-
deleteOptions
Description copied from interface:ModelSpec
Return the model's delete options- Specified by:
deleteOptions
in interfaceModelSpec<T>
- Returns:
- delete options
-
ttl
public long ttl()Description copied from interface:ModelSpec
Return the TTL to use or -1 -
schema
Description copied from interface:ModelSpec
Return a Curator schema that validates ZNodes at this model's path using this model's values -
equals
-
hashCode
public int hashCode() -
toString
-
isValid
public boolean isValid(Schema schema, String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl) - Specified by:
isValid
in interfaceSchemaValidator
- Parameters:
schema
- the schema being validatedpath
- the path being operated ondata
- data or nullacl
- acls or null- Returns:
- true if valid
-