Class ExecutionContext

java.lang.Object
net.sf.jailer.ExecutionContext

public class ExecutionContext extends Object
Execution context of import-/export commands.
Author:
Ralf Wisser
  • Field Details

    • defaultDatamodelFolder

      public static String defaultDatamodelFolder
  • Constructor Details

    • ExecutionContext

      public ExecutionContext()
      Default constructor.
    • ExecutionContext

      public ExecutionContext(ExecutionContext other)
      Copy constructor.
    • ExecutionContext

      public ExecutionContext(CommandLine commandLine)
      Creates new context with attributes taken from ExecutionContext.
      Parameters:
      commandLine - the command line
  • Method Details

    • getUTF8

      public boolean getUTF8()
      If true, Use UTF-8 encoding
      Returns:
      true if Use UTF-8 encoding
    • setUTF8

      public void setUTF8(boolean uTF8)
      If true, Use UTF-8 encoding
      Parameters:
      uTF8 - true if Use UTF-8 encoding
    • getTargetDBMS

      public DBMS getTargetDBMS()
      Gets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
      Returns:
      target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
    • setTargetDBMS

      public void setTargetDBMS(DBMS targetDBMS)
      Sets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
      Parameters:
      targetDBMS - target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
    • getXmlRootTag

      public String getXmlRootTag()
      Gets root tag of XML export file
      Returns:
      root tag of XML export file
    • setXmlRootTag

      public void setXmlRootTag(String xmlRootTag)
      Sets root tag of XML export file
      Parameters:
      xmlRootTag - root tag of XML export file
    • getXmlDatePattern

      public String getXmlDatePattern()
      Gets pattern for dates in XML and LIQUIBASE_XML export file
      Returns:
      pattern for dates in XML and LIQUIBASE_XML export file
    • setXmlDatePattern

      public void setXmlDatePattern(String xmlDatePattern)
      Sets pattern for dates in XML and LIQUIBASE_XML export file
      Parameters:
      xmlDatePattern - pattern for dates in XML and LIQUIBASE_XML export file
    • getXmlTimePattern

      public String getXmlTimePattern()
      Gets pattern for times in XML and LIQUIBASE_XML export file
      Returns:
      pattern for times in XML and LIQUIBASE_XML export file
    • setXmlTimePattern

      public void setXmlTimePattern(String xmlTimePattern)
      Sets pattern for times in XML and LIQUIBASE_XML export file
      Parameters:
      xmlTimePattern - pattern for times in XML and LIQUIBASE_XML export file
    • getXmlTimeStampPattern

      public String getXmlTimeStampPattern()
      Gets pattern for time-stamps in XML and LIQUIBASE_XML export file
      Returns:
      pattern for time-stamps in XML and LIQUIBASE_XML export file
    • setXmlTimeStampPattern

      public void setXmlTimeStampPattern(String xmlTimeStampPattern)
      Sets pattern for time-stamps in XML and LIQUIBASE_XML export file
      Parameters:
      xmlTimeStampPattern - pattern for time-stamps in XML and LIQUIBASE_XML export file
    • getQualifyNames

      public boolean getQualifyNames()
      If true, Add schema prefix to table names after analysing the DB
      Returns:
      true if Add schema prefix to table names after analysing the DB
    • setQualifyNames

      public void setQualifyNames(boolean qualifyNames)
      If true, Add schema prefix to table names after analysing the DB
      Parameters:
      qualifyNames - true if Add schema prefix to table names after analysing the DB
    • getAnalyseAlias

      public boolean getAnalyseAlias()
      If true, Look for aliases while analysing the DB
      Returns:
      true if Look for aliases while analysing the DB
    • setAnalyseAlias

      public void setAnalyseAlias(boolean analyseAlias)
      If true, Look for aliases while analysing the DB
      Parameters:
      analyseAlias - true if Look for aliases while analysing the DB
    • getAnalyseSynonym

      public boolean getAnalyseSynonym()
      If true, Look for synonyms while analysing the DB
      Returns:
      true if Look for synonyms while analysing the DB
    • setAnalyseSynonym

      public void setAnalyseSynonym(boolean analyseSynonym)
      If true, Look for synonyms while analysing the DB
      Parameters:
      analyseSynonym - true if Look for synonyms while analysing the DB
    • getAnalyseView

      public boolean getAnalyseView()
      If true, Look for views while analysing the DB
      Returns:
      true if Look for views while analysing the DB
    • setAnalyseView

      public void setAnalyseView(boolean analyseView)
      If true, Look for views while analysing the DB
      Parameters:
      analyseView - true if Look for views while analysing the DB
    • getNumberOfThreads

      public int getNumberOfThreads()
      Gets number of threads (default is 1)
      Returns:
      number of threads (default is 1)
    • setNumberOfThreads

      public void setNumberOfThreads(int numberOfThreads)
      Sets number of threads (default is 1)
      Parameters:
      numberOfThreads - number of threads (default is 1)
    • getNumberOfEntities

      public int getNumberOfEntities()
      Gets maximum number of entities per insert-statement (in export-file, default is 10)
      Returns:
      maximum number of entities per insert-statement (in export-file, default is 10)
    • setNumberOfEntities

      public void setNumberOfEntities(int numberOfEntities)
      Sets maximum number of entities per insert-statement (in export-file, default is 10)
      Parameters:
      numberOfEntities - maximum number of entities per insert-statement (in export-file, default is 10)
    • getUpsertOnly

      public boolean getUpsertOnly()
      If true, Generate 'upsert'-statements for all entities (in export-file)
      Returns:
      true if Generate 'upsert'-statements for all entities (in export-file)
    • setUpsertOnly

      public void setUpsertOnly(boolean upsertOnly)
      If true, Generate 'upsert'-statements for all entities (in export-file)
      Parameters:
      upsertOnly - true if Generate 'upsert'-statements for all entities (in export-file)
    • getScope

      public WorkingTableScope getScope()
      Gets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
      Returns:
      scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
    • setScope

      public void setScope(WorkingTableScope scope)
      Sets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
      Parameters:
      scope - scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
    • getWorkingTableSchema

      public String getWorkingTableSchema()
      Gets schema in which the working tables will be created
      Returns:
      schema in which the working tables will be created
    • setWorkingTableSchema

      public void setWorkingTableSchema(String workingTableSchema)
      Sets schema in which the working tables will be created
      Parameters:
      workingTableSchema - schema in which the working tables will be created
    • getDatamodelFolder

      public String getDatamodelFolder()
      Gets folder holding the data model. Defaults to './datamodel'
      Returns:
      folder holding the data model. Defaults to './datamodel'
    • setDatamodelFolder

      public void setDatamodelFolder(String datamodelFolder)
      Sets folder holding the data model. Defaults to './datamodel'
      Parameters:
      datamodelFolder - folder holding the data model. Defaults to './datamodel'
    • getQualifiedDatamodelFolder

      public String getQualifiedDatamodelFolder()
      Gets fully qualified folder name of current data model.
    • getNoSorting

      public boolean getNoSorting()
      If true, The exported rows will not be sorted according to foreign key constraints
      Returns:
      true if The exported rows will not be sorted according to foreign key constraints
    • setNoSorting

      public void setNoSorting(boolean noSorting)
      If true, The exported rows will not be sorted according to foreign key constraints
      Parameters:
      noSorting - true if The exported rows will not be sorted according to foreign key constraints
    • getOrderByPK

      public boolean getOrderByPK()
      If true, the exported rows will be ordered according to the primary key.
    • setOrderByPK

      public void setOrderByPK(boolean orderByPK)
      Parameters:
      orderByPK - if true, the exported rows will be ordered according to the primary key
    • getTransactional

      public boolean getTransactional()
      If true, Import rows in a single transaction
      Returns:
      true if Import rows in a single transaction
    • setTransactional

      public void setTransactional(boolean transactional)
      If true, Import rows in a single transaction
      Parameters:
      transactional - true if Import rows in a single transaction
    • getIsolationLevel

      public Integer getIsolationLevel()
      Gets IsolationLevel.
      See Also:
    • setIsolationLevel

      public void setIsolationLevel(Integer isolationLevel)
      Sets IsolationLevel.
      See Also:
    • getUseRowid

      public boolean getUseRowid()
      If true, use rowid/ctid-column to determine row identity (instead of primary keys)
      Returns:
      if true use rowid/ctid-column to determine row identity (instead of primary keys)
    • setUseRowid

      public void setUseRowid(boolean useRowid)
      If true, use rowid/ctid-column to determine row identity (instead of primary keys)
      Parameters:
      useRowid - if true use rowid/ctid-column to determine row identity (instead of primary keys)
    • getUseRowIdsOnlyForTablesWithoutPK

      public boolean getUseRowIdsOnlyForTablesWithoutPK()
      If true, use rowid/ctid-column only for tables without primary key.
      Returns:
      if true use rowid/ctid-column only for tables without primary key
    • setUseRowIdsOnlyForTablesWithoutPK

      public void setUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK)
      If true, use rowid/ctid-column only for tables without primary key.
      Parameters:
      useRowIdsOnlyForTablesWithoutPK - if true use rowid/ctid-column only for tables without primary key
    • getAddGoBatchSeparator

      public boolean getAddGoBatchSeparator()
      Returns:
      if true, insert "GO" batch terminators into generated script (Microsoft SQL Server / Sybase).
    • setAddGoBatchSeparator

      public void setAddGoBatchSeparator(boolean addGoBatchSeparator)
      Parameters:
      addGoBatchSeparator - if true insert "GO" batch terminators into generated script (Microsoft SQL Server / Sybase)
    • getImportFilterMappingTableSchema

      public String getImportFilterMappingTableSchema()
      Gets schema in which the import-filter mapping tables will be created
      Returns:
      schema in which the import-filter mapping tables will be created
    • setImportFilterMappingTableSchema

      public void setImportFilterMappingTableSchema(String importFilterMappingTableSchema)
      Sets schema in which the import-filter mapping tables will be created
      Parameters:
      importFilterMappingTableSchema - schema in which the import-filter mapping tables will be created
    • isInsertIncrementally

      public boolean isInsertIncrementally()
      If true, collects the rows using multiple insert operations with a limited number of rows per operation.
      Use this option if otherwise the transactions become too big.
    • setInsertIncrementally

      public void setInsertIncrementally(boolean insertIncrementally)
      If true, collects the rows using multiple insert operations with a limited number of rows per operation.
      Use this option if otherwise the transactions become too big.
    • isAbortInCaseOfInconsistency

      public boolean isAbortInCaseOfInconsistency()
      Returns:
      if true, Subsetter.execute(String, File) throws an InconsistentSubsettingResultException if the result is inconsistent due to insufficient transaction isolation
    • setAbortInCaseOfInconsistency

      public void setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency)
      Parameters:
      abortInCaseOfInconsitency - if true, Subsetter.execute(String, File) throws an InconsistentSubsettingResultException if the result is inconsistent due to insufficient transaction isolation
    • isEmbedded

      public boolean isEmbedded()
      Is the subsetter embedded into an application?
      Returns:
      true if the subsetter is embedded into an application
    • setEmbedded

      public void setEmbedded(boolean embedded)
      Sets whether the subsetter is embedded into an application.
      Parameters:
      embedded - true if the subsetter is embedded into an application
    • getParameters

      public Map<String,String> getParameters()
      Gets parameters
      Returns:
      parameters
    • setParameter

      public void setParameter(String name, String value)
      Sets a parameter.
      Parameters:
      name - parameter name
      value - value
    • getSchemaMapping

      public static Map<String,String> getSchemaMapping(String rawschemamapping)
      Parses a raw schema mapping string (comma-separated "from=to" pairs) into a map.
      Parameters:
      rawschemamapping - comma-separated schema mapping string, e.g. "schema1=schema2,schema3=schema4"
      Returns:
      parsed schema mapping
    • getSchemaMapping

      public Map<String,String> getSchemaMapping()
      Gets schema map for destination database.
      Returns:
      schema map for destination database
    • setSchemaMapping

      public void setSchemaMapping(Map<String,String> schemaMapping)
      Sets schema map for destination database.
      Parameters:
      schemaMapping - destination schema map
    • setSourceSchemaMapping

      public void setSourceSchemaMapping(Map<String,String> sourceSchemaMapping)
      Sets schema map for source database.
      Parameters:
      sourceSchemaMapping - the source schema map
    • getSourceSchemaMapping

      public Map<String,String> getSourceSchemaMapping()
      Gets schema map for source database.
      Returns:
      the source schema map
    • setDeletionSchemaMapping

      public void setDeletionSchemaMapping(Map<String,String> deletionSchemaMapping)
      Sets schema map for the deletion script.
      Parameters:
      deletionSchemaMapping - the deletion schema map
    • getDeletionSchemaMapping

      public Map<String,String> getDeletionSchemaMapping()
      Gets schema map for the deletion script.
      Returns:
      the deletion schema map
    • getScriptFormat

      public ScriptFormat getScriptFormat()
      Gets the script format.
      Returns:
      the script format
    • setScriptFormat

      public void setScriptFormat(ScriptFormat scriptFormat)
      Sets the script format.
      Parameters:
      scriptFormat - the script format
    • setCurrentModelSubfolder

      public void setCurrentModelSubfolder(String modelFolder)
      Sets folder of current data model.
      Parameters:
      modelFolder - the folder, null for default model
    • getCurrentModelSubfolder

      public String getCurrentModelSubfolder()
      Gets folder of current data model.
      Returns:
      modelFolder the folder, null for default model
    • getDataModelURL

      public URL getDataModelURL()
      Gets URL of the current data model (the datamodel's base folder)
      Returns:
      URL of the current data model (the datamodel's base folder)
    • setDataModelURL

      public void setDataModelURL(URL datamodelURL)
      Sets URL of the current data model (the datamodel's base folder)
      Parameters:
      datamodelURL - URL of the data model base folder
    • isUnformatted

      public boolean isUnformatted()
      Returns:
      true: don't format JSON/YAML/XML export files
    • setUnformatted

      public void setUnformatted(boolean unformatted)
      Parameters:
      unformatted - true: don't format JSON/YAML/XML export files
    • isSingleRoot

      public boolean isSingleRoot()
      Returns:
      allow only a single root/subject object to be written out into JSON/YAML/XML export file
    • setSingleRoot

      public void setSingleRoot(boolean singleRoot)
      Parameters:
      singleRoot - allow only a single root/subject object to be written out into JSON/YAML/XML export file
    • isDisallowNonAggregated

      public boolean isDisallowNonAggregated()
      Returns:
      if true, raise an error if there are objects not aggregated into any other object in JSON/YAML/XML export file
    • setDisallowNonAggregated

      public void setDisallowNonAggregated(boolean disallowNonAggregated)
      Parameters:
      disallowNonAggregated - if true, raise an error if there are objects not aggregated into any other object in JSON/YAML/XML export file
    • isIncludeNonAggregated

      public boolean isIncludeNonAggregated()
      Returns:
      write out all objects that are not aggregated in any other object at root level into JSON/YAML/XML export file
    • setIncludeNonAggregated

      public void setIncludeNonAggregated(boolean includeNonAggregated)
      Parameters:
      includeNonAggregated - write out all objects that are not aggregated in any other object at root level into JSON/YAML/XML export file
    • isIgnoreNonAggregated

      public boolean isIgnoreNonAggregated()
      Returns:
      don't write out any object that are not aggregated in any other object into JSON/YAML/XML export file
    • setIgnoreNonAggregated

      public void setIgnoreNonAggregated(boolean ignoreNonAggregated)
      Parameters:
      ignoreNonAggregated - don't write out any object that are not aggregated in any other object into JSON/YAML/XML export file
    • getProgressListenerRegistry

      public ProgressListenerRegistry getProgressListenerRegistry()
      Returns:
      the ProgressListenerRegistry
    • setProgressListenerRegistry

      public void setProgressListenerRegistry(ProgressListenerRegistry progressListenerRegistry)
      Parameters:
      progressListenerRegistry - the ProgressListenerRegistry
    • getLayoutStorage

      public LayoutStorage getLayoutStorage()
      Gets the layout storage.
      Returns:
      the layout storage
    • setLayoutStorage

      public void setLayoutStorage(LayoutStorage layoutStorage)
      Sets the layout storage.
      Parameters:
      layoutStorage - the layout storage
    • getLimit

      public Long getLimit()
      Returns:
      maximum allowed number of exported rows. If this limit is exceeded, the export aborts with an error.
    • setLimit

      public void setLimit(Long limit)
      Parameters:
      limit - maximum allowed number of exported rows. If this limit is exceeded, the export aborts with an error.
    • isIndependentWorkingTables

      public boolean isIndependentWorkingTables()
      Create working tables that are independent of the extraction model. (Potentially less efficient)
    • setIndependentWorkingTables

      public void setIndependentWorkingTables(boolean independentWorkingTables)
      Create working tables that are independent of the extraction model. (Potentially less efficient)
    • getUpkDomain

      public Set<String> getUpkDomain()
      Gets the universal primary key domain.
      Returns:
      the universal primary key domain
    • setUpkDomain

      public void setUpkDomain(Set<String> upkDomain)
      Sets the universal primary key domain.
      Parameters:
      upkDomain - the universal primary key domain
    • getCurrentConnectionAlias

      public String getCurrentConnectionAlias()
      Gets the alias of the current connection.
      Returns:
      the current connection alias
    • setCurrentConnectionAlias

      public void setCurrentConnectionAlias(String currentConnectionAlias)
      Sets the alias of the current connection.
      Parameters:
      currentConnectionAlias - the current connection alias
    • getLocalDatabaseStorage

      public String getLocalDatabaseStorage()
      Returns:
      the folder where the local database will be stored. If null, default temp folder is used.
    • setLocalDatabaseStorage

      public void setLocalDatabaseStorage(String localDatabaseStorage)
      Sets the folder where the local database will be stored.
      Parameters:
      localDatabaseStorage - the folder where the local database will be stored. If null, default temp folder is used.