Class SchemaSet


  • public class SchemaSet
    extends java.lang.Object
    Collection of all schemas for a Curator instance
    • Constructor Summary

      Constructors 
      Constructor Description
      SchemaSet​(java.util.List<Schema> schemas, boolean useDefaultSchema)
      Define a schema set.
    • Constructor Detail

      • SchemaSet

        public SchemaSet​(java.util.List<Schema> schemas,
                         boolean useDefaultSchema)
        Define a schema set. Schemas are matched in a well defined order:
        1. Exact match on full path (i.e. non-regex)
        2. Match on the first regex path, searched in the order given to this constructor
        Parameters:
        schemas - the schemas for the set.
        useDefaultSchema - if true, return a default schema when there is no match. Otherwise, an exception is thrown
    • Method Detail

      • getDefaultSchemaSet

        public static SchemaSet getDefaultSchemaSet()
        Return the default (empty) schema set
        Returns:
        default schema set
      • getSchemas

        public java.util.Collection<Schema> getSchemas()
        Return the schemas
        Returns:
        schemas
      • getSchema

        public Schema getSchema​(java.lang.String path)
        Find the first matching schema for the path and return it
        Parameters:
        path - ZNode full path
        Returns:
        matching schema or a default schema
      • getNamedPath

        public static java.lang.String getNamedPath​(CuratorFramework client,
                                                    java.lang.String name)
        Utility to return a ZNode path for the given name
        Parameters:
        client - Curator client
        name - path/schema name
        Returns:
        ZNode path
      • getNamedSchema

        public Schema getNamedSchema​(java.lang.String name)
        Return the schema with the given key/name
        Parameters:
        name - name
        Returns:
        schema or null
      • toDocumentation

        public java.lang.String toDocumentation()
        Build a user displayable documentation string for the schemas in this set
        Returns:
        documentation