|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.util.prefs.PreferencesUpgrade
public abstract class PreferencesUpgrade
Performs an upgrade of a set of preferences from one configuration schema version to another (where a set of preferences is tagged by what is called a "configuration schema version" or simply a "configuration version").
Subclasses need only implement getConfigurationSchemaVersionPreference() to indicate the name of the
preference key that contains the configuration schema version number for the preferences to be upgraded and to ensure
they override the constructor PreferencesUpgrade(List) passing in the appropriate upgrade
steps. Calling upgrade(Preferences, int) on instances of a subclass will use those installed
upgrade steps to perform the actual upgrade.
| Constructor Summary | |
|---|---|
PreferencesUpgrade(List<PreferencesUpgradeStep> upgrade_steps)
Constructor for PreferencesUpgrade given a set of upgrade step instructions for each known, supported
configuration schema version. |
|
| Method Summary | |
|---|---|
int |
getConfigurationSchemaVersion(Preferences preferences)
Given a set of preferences, this will ask for its configuration schema version. |
abstract String |
getConfigurationSchemaVersionPreference()
Returns the name of the preference whose value is the configuration schema version of the entire set of preferences. |
void |
setConfigurationSchemaVersion(Preferences preferences,
int version)
Given a set of preferences, this will set its configuration schema version to the given version number. |
void |
upgrade(Preferences preferences,
int upgrade_to_version)
This will upgrade the given set of preferences to the given configuration schema version. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PreferencesUpgrade(List<PreferencesUpgradeStep> upgrade_steps)
PreferencesUpgrade given a set of upgrade step instructions for each known, supported
configuration schema version. The given list must be ordered from the lowest supported configuration version to
the latest supported version.
upgrade_steps - the list of upgrade steps that are used to perform the upgrades from one version to another| Method Detail |
|---|
public void upgrade(Preferences preferences,
int upgrade_to_version)
preferences - the set of preferences to upgradeupgrade_to_version - the configuration version to upgrade the preferences topublic int getConfigurationSchemaVersion(Preferences preferences)
preferences - the set of preferences whose version is to be returned
public void setConfigurationSchemaVersion(Preferences preferences,
int version)
preferences - the set of preferences whose version is to be setversion - the new version of the preferencespublic abstract String getConfigurationSchemaVersionPreference()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||