Interface ModelSpec<T>

  • All Superinterfaces:
    Resolvable
    All Known Implementing Classes:
    ModelSpecImpl

    public interface ModelSpec<T>
    extends Resolvable
    A full specification for dealing with a portion of the ZooKeeper tree. ModelSpec's contain:
    • A node path
    • Serializer for the data stored
    • Options for how to create the node (mode, compression, etc.)
    • Options for how to deleting the node (quietly, guaranteed, etc.)
    • ACLs
    • Optional schema generation
    • Field Detail

      • defaultCreateOptions

        static final java.util.Set<CreateOption> defaultCreateOptions
      • defaultDeleteOptions

        static final java.util.Set<DeleteOption> defaultDeleteOptions
    • Method Detail

      • child

        ModelSpec<T> child​(java.lang.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().

        Parameters:
        child - child node.
        Returns:
        new Modeled Spec instance
      • parent

        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().

        Returns:
        new Modeled Spec instance
      • withPath

        ModelSpec<T> withPath​(ZPath path)
        Return a new CuratorModel instance with all the same options but using the given path.
        Parameters:
        path - new path
        Returns:
        new Modeled Spec instance
      • resolved

        ModelSpec<T> resolved​(java.lang.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().

        Specified by:
        resolved in interface Resolvable
        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

        ModelSpec<T> resolved​(java.util.List<java.lang.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().

        Specified by:
        resolved in interface Resolvable
        Parameters:
        parameters - list of replacements. Must have be the same length as the number of parameter nodes in the path
        Returns:
        new resolved ModelSpec
      • path

        ZPath path()
        Return the model's path
        Returns:
        path
      • serializer

        ModelSerializer<T> serializer()
        Return the model's serializer
        Returns:
        serializer
      • createMode

        org.apache.zookeeper.CreateMode createMode()
        Return the model's create mode
        Returns:
        create mode
      • aclList

        java.util.List<org.apache.zookeeper.data.ACL> aclList()
        Return the model's ACL list
        Returns:
        ACL list
      • createOptions

        java.util.Set<CreateOption> createOptions()
        Return the model's create options
        Returns:
        create options
      • deleteOptions

        java.util.Set<DeleteOption> deleteOptions()
        Return the model's delete options
        Returns:
        delete options
      • ttl

        long ttl()
        Return the TTL to use or -1
        Returns:
        ttl
      • schema

        org.apache.curator.framework.schema.Schema schema()
        Return a Curator schema that validates ZNodes at this model's path using this model's values
        Returns:
        schema