Class MockSchemaApi

  • All Implemented Interfaces:
    SchemaApi, SchemaUtil, java.io.Closeable, java.lang.AutoCloseable

    public class MockSchemaApi
    extends java.lang.Object
    implements SchemaApi, java.io.Closeable
    • Constructor Detail

      • MockSchemaApi

        public MockSchemaApi()
      • MockSchemaApi

        public MockSchemaApi​(Schema... schemas)
    • Method Detail

      • getSchemaNames

        public java.util.List<java.lang.String> getSchemaNames()
        Description copied from interface: SchemaApi
        Get the names of all available schemas.
        Specified by:
        getSchemaNames in interface SchemaApi
      • getSchema

        public Schema getSchema​(java.lang.String schemaName)
        Description copied from interface: SchemaApi
        Fetch a schema according to schemaName.

        If schemaName is null, the default schema will be returned, if available.

        Returns null if schema does not exist.

        Specified by:
        getSchema in interface SchemaApi
        Specified by:
        getSchema in interface SchemaUtil
        Parameters:
        schemaName - the schema name
        Returns:
        the schema
      • addSchema

        public Schema addSchema​(Schema schema)
        Description copied from interface: SchemaApi
        Add/update schema

        WARNING: System restart will be required for all components to take notice of the new/modified schema.

        Specified by:
        addSchema in interface SchemaApi
      • removeSchema

        public void removeSchema​(java.lang.String schemaName)
        Description copied from interface: SchemaApi
        Remove a schema from the system.

        WARNING: System restart will be required for all components to take notice of the removed schema.

        Specified by:
        removeSchema in interface SchemaApi
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • createDefaultSchema

        public static Schema createDefaultSchema()