Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.migration
Interface Migrator

All Known Implementing Classes:
AuditPreferencesMigrator, CodeEditorMigrator, DTCacheMigrator, ExcludeFilterSettingsMigrator, ExtensionMigrator, IdeSettingsMigrator, IdeSystemMigrator, LibraryMigrator, ProfileMigrator, UserPropertiesMigrator, VCSPropertyMapMigrator, XMLMigrator

public interface Migrator

The Migrator interface is used for migrating user customizable settings from previous installations of JDeveloper to the user home of a new installation. Migration may take place during one or both of two migration "phases". The first phase of migration occurs at startup before the IDE has been completely initialized and is signalled by a direct call to the migrate method of the Migrator. First phase migration should deal with the raw migration of files and should avoid trying to access any state information of the IDE itself. Second phase migration may be performed upon notification that all addins have been loaded indicating that the IDE is in a valid initialized state. Second phase migration usually involves tweaking a file that has already been migrated by an associated first phase Migrator implementation. For example; an extension that persists its settings in the settings.xml file may require a second phase Migrator to tweak the resultant file that was migrated by the associated first phase Migrator oracle.ide.config.IdeSettingsMigrator. In this example, the second phase Migrator would not attempt to migrate the settings.xml file itself, but rather would simply add itself as an oracle.ide.IdeListener of the IDE and wait for the addinsLoaded event in order to make the necessary changes to the live object returned by oracle.ide.Ide.getSettings(). This would ensure that the live object reflected the new values which in turn would be persisted by the live object at the next opportunity, thereby resulting in a fully migrated settings.xml on disk. Note that when using this approach, before tweaking any objects, the second phase Migrator would be expected to verify that the first phase Migrator actually allowed first phase migration by checking the isSelected method for the category of interest on the first phase Migrator. No more than a single first phase Migrator implementation should ever attempt to migrate a given file. Any number of second phase Migrator implementations may attempt to alter the live object resulting from the loading of the file migrated by the first phase Migrator.


Field Summary
static java.lang.String JDEV_HOME_DIR
          Legacy directory, under , in which user SYSTEM_DIR is created.
static java.lang.String SYSTEM_DIR
          Legacy directory, under \jdevhome, in which user settings are saved.
 
Method Summary
 boolean canMigrate(int category, java.io.File sourceDir)
          Determine whether a given category can be migrated from a given directory.
 java.lang.String getDescription(int category)
          Get a one line description for a given migration category.
 int[] getMigrationCategories()
          Get an array of unique id values representing available categories to migrate.
 boolean isSelected(int category)
          Determine whether a category has been flagged for migration.
 java.lang.String[] migrate(java.io.File sourceDir, java.io.File destDir)
          Migrate all flagged categories, from a given source directory, to a given destination directory.
 void setSelected(int category, boolean selected)
          Flag a category as selected for migration.
 

Field Detail

SYSTEM_DIR

static final java.lang.String SYSTEM_DIR
Legacy directory, under \jdevhome, in which user settings are saved.

See Also:
Constant Field Values

JDEV_HOME_DIR

static final java.lang.String JDEV_HOME_DIR
Legacy directory, under , in which user SYSTEM_DIR is created.

See Also:
Constant Field Values
Method Detail

getMigrationCategories

int[] getMigrationCategories()
Get an array of unique id values representing available categories to migrate.


getDescription

java.lang.String getDescription(int category)
Get a one line description for a given migration category. A null result implies that no UI should be presented to the user for the given category.


canMigrate

boolean canMigrate(int category,
                   java.io.File sourceDir)
Determine whether a given category can be migrated from a given directory.


setSelected

void setSelected(int category,
                 boolean selected)
Flag a category as selected for migration.


isSelected

boolean isSelected(int category)
Determine whether a category has been flagged for migration.


migrate

java.lang.String[] migrate(java.io.File sourceDir,
                           java.io.File destDir)
Migrate all flagged categories, from a given source directory, to a given destination directory. Does nothing if no categories have been flagged for migration.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.