Interface DatasourceHelperService


public interface DatasourceHelperService
  • Method Details

    • copyTable

      Map<String,Object> copyTable(DatabaseDatasource sourceDatasource, String sourceTable, DatabaseDatasource destinationDatasource, String destinationTable, List<String> primaryKeys, boolean copyPrimaryKeys, int batchSize)
    • tableExists

      boolean tableExists(DatabaseDatasource datasource, String table)
    • getNonExistingColumns

      List<String> getNonExistingColumns(DatabaseDatasource datasource, String table, List<String> columns)
      Returns the columns which do not exist in the given table. This is a subset of the columns parameter. If the result is empty, all columns are found in the given table.
      Parameters:
      datasource - the datasource
      table - the table to check
      columns - the columns to check
      Returns:
      the non-existing columns in the table
    • getColumnMetadata

      List<Map<String,Object>> getColumnMetadata(DatabaseDatasource datasource, String table)
    • getColumnMetadata

      List<Map<String,Object>> getColumnMetadata(DatabaseDatasource datasource, String table, List<String> additionalColumns)
    • fetchDatasourceMetadata

      Map<String,Object> fetchDatasourceMetadata(DatabaseDatasource datasource, Map<String,List<String>> methodDescriptions) throws SQLException
      Dynamically calls a methods from the class DatabaseMetaData. Any method is call-able. The call fails if argument count and name does not match exactly one method of said class. The call fails as well if the args cannot be converted into the needed parameter types. If "null" is passed as a String in args it will be evaluated to null as an Object. Boolean and Integer are converted using String.toBoolean() and String.toInteger()
      Parameters:
      datasource - the datasource
      methodDescriptions - is a map with the structure keys:= method name as String | values:= parameters as List of String
      Returns:
      a map with the structure keys:= method name as String | values:= return-object of called method
      Throws:
      SQLException
    • fetchDatasourceMetadata

      Map<String,Object> fetchDatasourceMetadata(String driverClass, String jdbcUrl, String jdbcUsername, String jdbcPassword, Map<String,List<String>> methodDescriptions) throws SQLException
      Throws:
      SQLException
    • fetchInfoDatasourceMetadata

      Map<String,Object> fetchInfoDatasourceMetadata(DatasourceDefinition datasource, boolean datasourceInfo, boolean jdbcUrlInfo, boolean databaseFunctionsInfo, boolean databaseSupportsInfo) throws SQLException
      Fetches general metadata information about a given datasource. Information about which data is acquired with getDatasourceInfoDefinition(), which provides a config map
      Parameters:
      datasource - the datasource
      datasourceInfo - if true, fetches general information
      jdbcUrlInfo - if true, fetches URL information
      databaseFunctionsInfo - if true, fetches information on functions
      databaseSupportsInfo - if true, fetches information on supports
      Returns:
      the map containing invalid input: '<'methodname, result>
      Throws:
      SQLException
    • fetchInfoDatasourceMetadata

      Map<String,Object> fetchInfoDatasourceMetadata(String driverClass, String jdbcUrl, String jdbcUsername, String jdbcPassword, boolean datasourceInfo, boolean jdbcUrlInfo, boolean databaseFunctionsInfo, boolean databaseSupportsInfo) throws SQLException
      Throws:
      SQLException
    • getDatasourceInfoDefinition

      Map<DatasourceInfoType,Map<String,String>> getDatasourceInfoDefinition()
      Provides a map containing what information is fetched when using fetchDatasourceMetadata(). This map has keys of type DatasourceInfoType. Each key points to another Map of type invalid input: '<'String,String> with the structure 'method description' -> 'method name'
      Returns:
      the config map
    • getQuery

      String getQuery(DatasourceContainer datasourceContainer)
    • getGeneralInformation

      Map<String,Object> getGeneralInformation(DatasourceDefinition datasource)