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
ConstructorsConstructorDescriptionModelSpecImpl(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.CreateModeReturn the model's create modeReturn the model's create optionsReturn the model's delete optionsbooleaninthashCode()booleanparent()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()longttl()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:ModelSpecReturn 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:ModelSpecReturn 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:ModelSpecReturn 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:
resolvedin interfaceModelSpec<T>- Specified by:
resolvedin 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:ModelSpecReturn 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:
resolvedin interfaceModelSpec<T>- Specified by:
resolvedin 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:ModelSpecReturn a new CuratorModel instance with all the same options but using the given path. -
path
Description copied from interface:ModelSpecReturn the model's path -
serializer
Description copied from interface:ModelSpecReturn the model's serializer- Specified by:
serializerin interfaceModelSpec<T>- Returns:
- serializer
-
createMode
public org.apache.zookeeper.CreateMode createMode()Description copied from interface:ModelSpecReturn the model's create mode- Specified by:
createModein interfaceModelSpec<T>- Returns:
- create mode
-
aclList
Description copied from interface:ModelSpecReturn the model's ACL list -
createOptions
Description copied from interface:ModelSpecReturn the model's create options- Specified by:
createOptionsin interfaceModelSpec<T>- Returns:
- create options
-
deleteOptions
Description copied from interface:ModelSpecReturn the model's delete options- Specified by:
deleteOptionsin interfaceModelSpec<T>- Returns:
- delete options
-
ttl
public long ttl()Description copied from interface:ModelSpecReturn the TTL to use or -1 -
schema
Description copied from interface:ModelSpecReturn 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:
isValidin interfaceSchemaValidator- Parameters:
schema- the schema being validatedpath- the path being operated ondata- data or nullacl- acls or null- Returns:
- true if valid
-