Package 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
  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
  Description
  `static final String`
  `COMMON_SCHEMA_ID`
  `static final String`
  `COMMON_SCHEMA_VERSION`
  `protected static final Class[]`
  `SUPPORTED_CLASSES`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SchemaManager()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<SchemaManager.ResultEntry>`
  `checkUpgradeSupport(DataSource ds, List<SchemaManager.SchemaInfo> schemas)`
  `static List<BeanConfig>`
  `crawlKernel(List<Class<?>> repositoryClasses, Kernel kernel, DSLBeanConfigurator configurator, Map<String,Object> config)`
  `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<SchemaManager.RepoInfo>`
  `getRepositories(Kernel kernel, List<BeanConfig> repoBeans, Map<String,Object> config)`
  `static List<BeanConfig>`
  `getRepositoryBeans(Kernel kernel, List<Class<?>> repositoryClasses, Map<String,Object> config)`
  `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)`
  `static Kernel`
  `prepareKernel(Map<String,Object> config)`
  `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 Details

  - ### 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 Details

  - ### SchemaManager

    public SchemaManager()

- ## Method Details

  - ### 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)

  - ### getRepositories

    public static List<SchemaManager.RepoInfo> getRepositories(Kernel kernel, List<BeanConfig> repoBeans, Map<String,Object> config)

  - ### prepareKernel

    public static Kernel prepareKernel(Map<String,Object> config)

  - ### getRepositoryBeans

    public static List<BeanConfig> getRepositoryBeans(Kernel kernel, List<Class<?>> repositoryClasses, Map<String,Object> config)

  - ### crawlKernel

    public static List<BeanConfig> crawlKernel(List<Class<?>> repositoryClasses, Kernel kernel, DSLBeanConfigurator configurator, Map<String,Object> config)