Class SchemaSet

java.lang.Object
org.apache.curator.framework.schema.SchemaSet

public class SchemaSet extends Object
Collection of all schemas for a Curator instance
  • Constructor Details

    • SchemaSet

      public SchemaSet(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 Details

    • getDefaultSchemaSet

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

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

      public Schema getSchema(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 String getNamedPath(CuratorFramework client, 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(String name)
      Return the schema with the given key/name
      Parameters:
      name - name
      Returns:
      schema or null
    • toDocumentation

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