public abstract class PreferencesUpgrade extends Object
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 and Description |
|---|
PreferencesUpgrade(List<PreferencesUpgradeStep> upgrade_steps)
Constructor for
PreferencesUpgrade given a set of upgrade step instructions for each known, supported
configuration schema version. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 anotherpublic 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 returnedpublic 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()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.