Interface VersionStorage
- All Known Implementing Classes:
JcrVersionStorage
,SqlVersionStorage
public interface VersionStorage
Store the versions of a migration component and acts as a factory to create specific configuration objects.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Version
createVersion
(String componentId, MigrationEngine.MigrationComponent component, VersionConfiguration storageConfiguration, Map<String, Object> additionalValues) Creates a new version object, used to initialize the migration process.createVersionConfiguration
(Configuration versionConfiguration) Create a specific object containing useful data for the handler/storagegetId()
Get the unique identifiergetVersions
(String componentId, VersionConfiguration storageConfiguration, MigrationEngine.MigrationComponent component) Get the history of all versions for a component identifiervoid
removeAllVersions
(String componentIdentifier, VersionConfiguration configuration) Remove all versions for a component identifiervoid
removeVersion
(String componentId, String versionNumber, VersionConfiguration configuration) Removes a stored versionvoid
storeVersion
(Version version) Add a version
-
Method Details
-
getId
Get the unique identifier- Returns:
- The identifier
-
getVersions
List<Version> getVersions(String componentId, VersionConfiguration storageConfiguration, MigrationEngine.MigrationComponent component) throws MigrationException Get the history of all versions for a component identifier- Parameters:
componentId
- the component idcomponent
- the context componentstorageConfiguration
- configuration for this storage- Returns:
- list of all versions for this component
- Throws:
MigrationException
- Something went wrong
-
storeVersion
Add a version- Parameters:
version
- Version to store (contains the component identifier)- Throws:
MigrationException
- Something went wrong
-
removeVersion
void removeVersion(String componentId, String versionNumber, VersionConfiguration configuration) throws MigrationException Removes a stored version- Parameters:
componentId
- the componentversionNumber
- the version to removeconfiguration
- the associated configuration- Throws:
MigrationException
- Something went wrong
-
removeAllVersions
void removeAllVersions(String componentIdentifier, VersionConfiguration configuration) throws MigrationException Remove all versions for a component identifier- Parameters:
componentIdentifier
- component to clearconfiguration
- configuration to use- Throws:
MigrationException
- Something went wrong
-
createVersionConfiguration
VersionConfiguration createVersionConfiguration(Configuration versionConfiguration) throws ConfigurationException, NotMigrableInSafeModeException Create a specific object containing useful data for the handler/storage- Parameters:
versionConfiguration
- configuration from the plugin.xml- Returns:
- the confuguration object
- Throws:
ConfigurationException
- something wrong in the configurationNotMigrableInSafeModeException
- it it's impossible to configure the versions in safe mode
-
createVersion
default Version createVersion(String componentId, MigrationEngine.MigrationComponent component, VersionConfiguration storageConfiguration, Map<String, Object> additionalValues) throws MigrationExceptionCreates a new version object, used to initialize the migration process. This version is actually NOT stored.
Depending of the context, the createdVersion
could have the "0" number (ie. all actions should be executed), ornull
number (ie. only initialization action should be executed and the actual version number set to the highest available).- Parameters:
componentId
- the component idcomponent
- the context componentstorageConfiguration
- configuration for this storageadditionalValues
- all specific values used by upgrade actions- Returns:
- the newly created Version
- Throws:
MigrationException
- Impossible to create the version
-