Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.admin.tools.schema
Class SchemaUpgrade

    java.lang.Object
      oracle.ifs.admin.tools.schema.SchemaUpgrade

All Implemented Interfaces:
  java.util.EventListener, ActionQueueListener, IfsParameters

    public class SchemaUpgrade

extends java.lang.Object
implements ActionQueueListener, IfsParameters

The SchemaUpgrade class allows data-driven schema upgrades.

Modified:
  dpitfel 09/18/2008 Introduced SQLCommands.isFullTextIndexingEnabled., dpitfiel06/14/2007 Use S_LibrarySessionContentStorageManager to determine whether Oracle Text enabled., sgarg 05/22/2001 Replaced hard coded strings by ConfigurationModel constants., lsaenz 05/17/2001 Use S_Media.getContextEnabledState for skipping actions that require context., lsaenz 04/11/2001 Added skipping actions that need partitioning., lsaenz 04/10/2001 Added skipping actions that need context., lsaenz 04/09/2001 Updated comments, turned DEBUG off., lsaenz 03/14/2001 Use new keys from LibraryConstants., lsaenz 02/20/2001 Fixed bug in createUpgradeAction method., lsaenz 02/12/2001 Use ParameterTable.parseTokenList in createUpgradeAction method., lsaenz 12/12/2000 In loadAction, use AbstractAction.setOptions., lsaenz 12/09/2000 Fixed setting default parameters., lsaenz 12/06/2000 Always use OutcomeSchemaVersion., lsaenz 12/04/2000 Generalized loading of actions; improved impl., lsaenz 11/03/2000 Changed to use DirectoryConstants., lsaenz 08/31/2000 Ignore minimum schema version in config file; only maximum should be considered when selecting which upgrade tasks to perform., lsaenz 08/30/2000 Handle schema version ranges and start current upgrade task number count at 50., lsaenz 08/24/2000 Got rid of last upgrade task number; records that information as the 5th component of the schema version., lsaenz 08/23/2000 Corrected last upgrade section check., lsaenz 08/20/2000 Pass options to Actions by reference; use server version as final schema version; use current task number when queuing actions., lsaenz 08/19/2000 Improved implementation., lsaenz 07/17/2000 Added CURRENTUPGRADETASK support., lsaenz 07/12/2000 Added more implementation., lsaenz 07/07/2000 Created.

Field Summary
`static java.lang.String` | `DEFAULTS_SECTION_KEY` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `MAX_SCHEMA_VERSION_KEY` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `MIN_SCHEMA_VERSION_KEY` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `OUTCOME_SCHEMA_VERSION_KEY` Key used in the SchemaUpgrade configuration file.
`static int` | `SIGNIFICANT_SCHEMA_VERSION_COMPONENTS` The number of version components that will be considered significant in determining the schema version.
`static java.lang.String` | `SKIP_IF_NO_CONTEXT` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `SKIP_IF_NO_PARTITIONING` Key used in the SchemaUpgrade configuration file.
`static SymbolType` | `SYMBOL_TYPE` The SymbolType used to denote variables in the SchemaUpgrade configuration file that should be replaced with values.
`static java.lang.String` | `TASKS_KEY` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `TEST_MODE_KEY` Key used in the SchemaUpgrade configuration file.
`static java.lang.String` | `UPGRADE_KEY` Key used in the SchemaUpgrade configuration file.
`static int` | `UPGRADE_TASK_START_VALUE` The starting value that will be used to keep track of upgrade tasks that have been attempted.
`static int` | `UPGRADE_TASK_VERSION_COMPONENT` The version components that will be used to determine the current task.

Fields inherited from interface oracle.ifs.utils.common.IfsParameters
`APPEND_LOG, DATABASE_URL, DB_USER_NAME, DB_USER_PASSWORD, DOMAIN_TYPE, ENABLE_SSL_SUPPORT, FOR_SCHEMA_UPGRADE, IFS_DOMAIN_DISPLAY_NAME, IFS_DOMAIN_NAME, IFS_SCHEMA_NAME, IFS_SCHEMA_PASSWORD, IFS_SERVICE_NAME, IFS_USER_NAME, IFS_USER_PASSWORD, INCLUDE_PATH, INITIAL_CONTEXT_FACTORY, LDAP_URL_DAS_LOOKUP, LDAP_USER_NAME, LDAP_USER_PASSWORD, OUTPUT_FILE, PARAMETER_FILE, REGISTRY, SCHEMA_VERSION_KEY, SECURITY_PROTOCOL_NAME, SERVICE_CONFIGURATION_NAME`

Constructor Summary
`SchemaUpgrade(java.lang.String parameterfile)` Creates a new SchemaUpgrade given a configuration file.

Method Summary
`void` | `actionFinished(Action action)` Invoked when an Action has finished successfully.
`void` | `actionQueueFailed(java.lang.Throwable t)` Invoked if the ActionQueue has failed.
`void` | `actionQueueFinished()` Invoked when the ActionQueue has finished.
`void` | `actionStarting(Action action)` Invoked when an Action is about to be performed.
`void` | `addSettings(oracle.ifs.admin.config.Settings settings)` Copies the properties from the given Settings object into this instance's options table.
`AbstractAction` | `generateUpgradeAction()` Generates a QueueAction that contains all the Actions necessary for a schema upgrade.
`java.lang.Object` | `getValue(java.lang.String key)` Returns the value bound to the given variable.
`static void` | `main(java.lang.String[] args)` Executes a schema upgrade given commandline arguments.
`void` | `performUpgrade()` Performs the schema upgrade in an ActionQueue.
`void` | `putValue(java.lang.String key, java.lang.Object value)` Adds a variable/value pair to the options table.
`void` | `setOptions(java.util.Hashtable options)` Replaces this instance's options table with the given Hashtable object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SYMBOL_TYPE

    public static final SymbolType SYMBOL_TYPE

  Description copied from class: `SchemaUpgrade`
  The SymbolType used to denote variables in the SchemaUpgrade configuration file that should be replaced with values. Defined as {var_name} (curly brace pairs).

### UPGRADE_TASK_VERSION_COMPONENT

    public static final int UPGRADE_TASK_VERSION_COMPONENT

  Description copied from class: `SchemaUpgrade`
  The version components that will be used to determine the current task. Currently defined as 5.

  See Also:
    Constant Field Values

### UPGRADE_TASK_START_VALUE

    public static final int UPGRADE_TASK_START_VALUE

  Description copied from class: `SchemaUpgrade`
  The starting value that will be used to keep track of upgrade tasks that have been attempted. Defined as `50`; the maximum task number is `99`.

  See Also:
    Constant Field Values

### SIGNIFICANT_SCHEMA_VERSION_COMPONENTS

    public static final int SIGNIFICANT_SCHEMA_VERSION_COMPONENTS

  Description copied from class: `SchemaUpgrade`
  The number of version components that will be considered significant in determining the schema version. Currently defined as 4.

  See Also:
    Constant Field Values

### UPGRADE_KEY

    public static final java.lang.String UPGRADE_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### MIN_SCHEMA_VERSION_KEY

    public static final java.lang.String MIN_SCHEMA_VERSION_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### MAX_SCHEMA_VERSION_KEY

    public static final java.lang.String MAX_SCHEMA_VERSION_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### OUTCOME_SCHEMA_VERSION_KEY

    public static final java.lang.String OUTCOME_SCHEMA_VERSION_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### TASKS_KEY

    public static final java.lang.String TASKS_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### DEFAULTS_SECTION_KEY

    public static final java.lang.String DEFAULTS_SECTION_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### TEST_MODE_KEY

    public static final java.lang.String TEST_MODE_KEY

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### SKIP_IF_NO_CONTEXT

    public static final java.lang.String SKIP_IF_NO_CONTEXT

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

### SKIP_IF_NO_PARTITIONING

    public static final java.lang.String SKIP_IF_NO_PARTITIONING

  Description copied from class: `SchemaUpgrade`
  Key used in the SchemaUpgrade configuration file.

  See Also:
    Constant Field Values

Constructor Detail

### SchemaUpgrade

    public SchemaUpgrade(java.lang.String parameterfile)

  Creates a new SchemaUpgrade given a configuration file.

  Parameters:
    `parameterfile` - the path to a ParameterTable configuration file which describes the schema upgrade.

Method Detail

### main

    public static void main(java.lang.String[] args)

  Description copied from class: `SchemaUpgrade`
  Executes a schema upgrade given commandline arguments.

  Parameters:
    `args` - commandline arguments:
    1. the schema upgrade configuration file
    n. additional arguments specifying upgrade parameters (of the form key=value).

### addSettings

    public void addSettings(oracle.ifs.admin.config.Settings settings)

  Description copied from class: `SchemaUpgrade`
  Copies the properties from the given Settings object into this instance's options table.

  Parameters:
    `settings` - the Settings object to use.

### setOptions

    public void setOptions(java.util.Hashtable options)

  Description copied from class: `SchemaUpgrade`
  Replaces this instance's options table with the given Hashtable object. Note: this method does nothing if the given Hashtable is null.

  Parameters:
    `options` - the Hashtable object to use.

### putValue

    public void putValue(java.lang.String key,
                         java.lang.Object value)

  Description copied from class: `SchemaUpgrade`
  Adds a variable/value pair to the options table. Variables in the SchemaUpgrade configuration file will be replaced with values based on this table.

  Parameters:
    `key` - the name of the variable.
    `value` - the value of the variable.
  Throws:
    `java.lang.NullPointerException` - if `value` is null.

### getValue

    public java.lang.Object getValue(java.lang.String key)

  Description copied from class: `SchemaUpgrade`
  Returns the value bound to the given variable.

  Parameters:
    `key` - the name of the variable.
  Returns:
    the value bound to the variable, or null if no value is bound.

### generateUpgradeAction

    public AbstractAction generateUpgradeAction()
                                         throws java.lang.InstantiationException,
                                                java.lang.IllegalAccessException,
                                                IfsException,
                                                java.lang.ClassNotFoundException,
                                                java.sql.SQLException,
                                                ActionFailedException

  Description copied from class: `SchemaUpgrade`
  Generates a QueueAction that contains all the Actions necessary for a schema upgrade. This method reads the schema upgrade configuration from the parameterfile given in this instance's constructor. Default options from the parameterfile, as well as options set explicitly on this instance (which override those in the parameterfile), are passed onto the upgrade Actions.

  The schema to upgrade can be specified in the configuration file, and can be overridden by using the setOption method.

  Returns:
    an Action which, when performed, will upgrade the schema to the latest version.
  Throws:
    `java.lang.InstantiationException`
    `java.lang.IllegalAccessException`
    `IfsException`
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`
    `ActionFailedException`

### performUpgrade

    public void performUpgrade()

  Description copied from class: `SchemaUpgrade`
  Performs the schema upgrade in an ActionQueue. This method can be used to execute a schema upgrade in a standalone manner, without having to create an ActionQueue.

  The "outputfile" parameter specified in the configuration file will be used for logging output. The "AppendLog" parameter will be used to determine whether the log file should be appended to or not.

  Note: this method blocks until the upgrade has finished or failed.

### actionQueueFinished

    public void actionQueueFinished()

  Description copied from interface: `ActionQueueListener`
  Invoked when the ActionQueue has finished. An ActionQueue has finished when all of its Action instances have finished. An Action is considered finished when its `perform` method has returned successfully.

  Specified by:
    `actionQueueFinished` in interface `ActionQueueListener`

### actionQueueFailed

    public void actionQueueFailed(java.lang.Throwable t)

  Description copied from interface: `ActionQueueListener`
  Invoked if the ActionQueue has failed. An ActionQueue has failed if any one of its Actions has failed. An ActionQueue can be considered fail-fast; that is, it will fail and stop executing Actions immediately upon a single Action having failed.

  Specified by:
    `actionQueueFailed` in interface `ActionQueueListener`
  Parameters:
    `t` - the error that occurred (usually an ActionFailedException).

### actionStarting

    public void actionStarting(Action action)

  Description copied from interface: `ActionQueueListener`
  Invoked when an Action is about to be performed.

  Specified by:
    `actionStarting` in interface `ActionQueueListener`
  Parameters:
    `action` - the Action that will be performed.

### actionFinished

    public void actionFinished(Action action)

  Description copied from interface: `ActionQueueListener`
  Invoked when an Action has finished successfully.

  Specified by:
    `actionFinished` in interface `ActionQueueListener`
  Parameters:
    `action` - the Action that has finished.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD