tigase.db.util

## Class SchemaManager

- java.lang.Object
- - tigase.db.util.SchemaManager

-     public class SchemaManager
      extends Object

  Created by andrzej on 02.05.2017.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SchemaManager.DataSourceInfo`
    `static class` | `SchemaManager.Pair<K,V>`
    `static class` | `SchemaManager.RepoInfo`
    `static class` | `SchemaManager.ResultEntry`
    `static class` | `SchemaManager.RootCredentials`
    `static class` | `SchemaManager.RootCredentialsCache`
    `static class` | `SchemaManager.SchemaInfo`
    `static interface` | `SchemaManager.SchemaLoaderExecutor`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMMON_SCHEMA_ID`
    `static String` | `COMMON_SCHEMA_VERSION`
    `protected static Class[]` | `SUPPORTED_CLASSES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SchemaManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<SchemaManager.ResultEntry>` | `checkUpgradeSupport(DataSource ds, List<SchemaManager.SchemaInfo> schemas)`
    `void` | `destroySchema(Properties props)`
    `Map<SchemaManager.DataSourceInfo,List<SchemaManager.ResultEntry>>` | `destroySchemas(Collection<SchemaManager.DataSourceInfo> dataSources)`
    `List<SchemaManager.ResultEntry>` | `destroySchemas(DataSource ds)`
    `void` | `execute(String[] args)`
    `static Map<SchemaManager.DataSourceInfo,List<SchemaManager.SchemaInfo>>` | `getDataSourcesAndSchemas(Map<String,Object> config)`
    `static Map<SchemaManager.DataSourceInfo,List<SchemaManager.SchemaInfo>>` | `getDefaultDataSourceAndSchemas(String dbUri)`
    `static Optional<SchemaManager.SchemaInfo>` | `getDefaultSchemaFor(String dbUri, String schemaId, Set<String> components)`
    `static Optional<String>` | `getProperty(Properties props, CommandlineParameter parameter)`
    `static <T> Optional<T>` | `getProperty(Properties props, CommandlineParameter parameter, Function<String,T> converter)`
    `static List<Class<?>>` | `getRepositoryClasses()`
    `void` | `installSchema(Properties props)`
    `Map<SchemaManager.DataSourceInfo,List<SchemaManager.ResultEntry>>` | `loadSchemas()`
    `List<SchemaManager.ResultEntry>` | `loadSchemas(DataSource ds, List<SchemaManager.SchemaInfo> schemas)`
    `static void` | `main(String[] args)`
    `void` | `readConfig(File file)`
    `void` | `readConfig(Reader reader)`
    `void` | `readConfig(String configString)`
    `void` | `setAdmins(List<BareJID> admins, String adminPass)`
    `void` | `setConfig(Map<String,Object> config)`
    `void` | `setDbRootCredentials(String user, String pass)`
    `void` | `upgradeSchema(Properties props)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SUPPORTED_CLASSES

          protected static final Class[] SUPPORTED_CLASSES

    - #### COMMON_SCHEMA_ID

          public static final String COMMON_SCHEMA_ID

      See Also:
        Constant Field Values

    - #### COMMON_SCHEMA_VERSION

          public static final String COMMON_SCHEMA_VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SchemaManager

          public SchemaManager()

  - ### Method Detail

    - #### getProperty

          public static Optional<String> getProperty(Properties props,
                                                     CommandlineParameter parameter)

    - #### getProperty

          public static <T> Optional<T> getProperty(Properties props,
                                                    CommandlineParameter parameter,
                                                    Function<String,T> converter)

    - #### getRepositoryClasses

          public static List<Class<?>> getRepositoryClasses()

    - #### main

          public static void main(String[] args)
                           throws IOException,
                                  ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### execute

          public void execute(String[] args)
                       throws Exception

      Throws:
        `Exception`

    - #### destroySchema

          public void destroySchema(Properties props)
                             throws IOException,
                                    ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### installSchema

          public void installSchema(Properties props)
                             throws IOException,
                                    ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### upgradeSchema

          public void upgradeSchema(Properties props)
                             throws IOException,
                                    ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### readConfig

          public void readConfig(File file)
                          throws IOException,
                                 ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### readConfig

          public void readConfig(String configString)
                          throws IOException,
                                 ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### readConfig

          public void readConfig(Reader reader)
                          throws IOException,
                                 ConfigReader.ConfigException

      Throws:
        `IOException`
        `ConfigReader.ConfigException`

    - #### setAdmins

          public void setAdmins(List<BareJID> admins,
                                String adminPass)

    - #### setConfig

          public void setConfig(Map<String,Object> config)

    - #### setDbRootCredentials

          public void setDbRootCredentials(String user,
                                           String pass)

    - #### getDefaultDataSourceAndSchemas

          public static Map<SchemaManager.DataSourceInfo,List<SchemaManager.SchemaInfo>> getDefaultDataSourceAndSchemas(String dbUri)

    - #### getDefaultSchemaFor

          public static Optional<SchemaManager.SchemaInfo> getDefaultSchemaFor(String dbUri,
                                                                               String schemaId,
                                                                               Set<String> components)

    - #### getDataSourcesAndSchemas

          public static Map<SchemaManager.DataSourceInfo,List<SchemaManager.SchemaInfo>> getDataSourcesAndSchemas(Map<String,Object> config)

    - #### destroySchemas

          public Map<SchemaManager.DataSourceInfo,List<SchemaManager.ResultEntry>> destroySchemas(Collection<SchemaManager.DataSourceInfo> dataSources)

    - #### destroySchemas

          public List<SchemaManager.ResultEntry> destroySchemas(DataSource ds)

    - #### loadSchemas

          public Map<SchemaManager.DataSourceInfo,List<SchemaManager.ResultEntry>> loadSchemas()

    - #### checkUpgradeSupport

          public List<SchemaManager.ResultEntry> checkUpgradeSupport(DataSource ds,
                                                                     List<SchemaManager.SchemaInfo> schemas)

    - #### loadSchemas

          public List<SchemaManager.ResultEntry> loadSchemas(DataSource ds,
                                                             List<SchemaManager.SchemaInfo> schemas)

Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.