com.partnersoft.update
Class ModuleMigration

java.lang.Object
  extended by com.partnersoft.update.ModuleMigration

public class ModuleMigration
extends java.lang.Object

Runs scripted updates to module data after the main update program is complete.

The installation update simply replaces configuration, module, and platform files; however it does not touch data files, which are assumed to be unique to an installation and to contain precious user data.

These files cannot be updated in a generic manner; instead scripts can be provided by a module to modify them as needed - for example, to apply cascade updates to lookup values, or change file formats.

Each module can specify a "config version", this is an integer that is incremented each time the config changes in a non-backwards-compatible way that will require scripts to accomodate. This should not be confused with the module's own version, which specifies the version of the module's code but not its configuration.

The module's config version is stored in config/FOO/modules/BAR/update/ConfigVersion.txt. The file contains only a single integer. The scripts required to update local data from e.g. version 3 to version 4 are stored in config/FOO/modules/BAR/update/migrations/4/scripts. The scripts are run in alphabetical order and have the module variable defined.

The current config version of the module's data is stored in data/BAR/update/ConfigVersion.txt. This is updated after an update to the same as the one in config/.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
ModuleMigration(Module module)
          Create a StakerVersionUpdate.
 
Method Summary
 void migrate()
          Runs version update scripts.
 void migrateImportedJobFile(int currentVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleMigration

public ModuleMigration(Module module)
Create a StakerVersionUpdate. *shrug*

Method Detail

migrate

public void migrate()
             throws java.io.IOException
Runs version update scripts.

Throws:
java.io.IOException

migrateImportedJobFile

public void migrateImportedJobFile(int currentVersion)
                            throws java.io.IOException
Throws:
java.io.IOException