Interface VersionHandler
- All Known Implementing Classes:
AbstractVersionHandler
,JavaVersionHandler
,ScriptVersionHandler
,SingleVersionHandler
public interface VersionHandler
Handler to get or set version
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVersion
(Version newVersion) Adds a new version for a componentgetConfiguration
(String componentId, Configuration versionConfiguration) Create a specific object containing usefull data for the handler/storagegetCurrentVersions
(String componentId, VersionConfiguration configuration) Get the list of all curent versions for this component id based on the configuration
-
Method Details
-
getConfiguration
VersionConfiguration getConfiguration(String componentId, Configuration versionConfiguration) throws ConfigurationException, NotMigrableInSafeModeException Create a specific object containing usefull data for the handler/storage- Parameters:
componentId
- id of the componentversionConfiguration
- configuration from the plugin.xml- Returns:
- the confuguration object
- Throws:
ConfigurationException
- something wrong in the configurationNotMigrableInSafeModeException
- Impossible to determine the version (e.g. Safe Mode without access to the conf)
-
getCurrentVersions
List<Version> getCurrentVersions(String componentId, VersionConfiguration configuration) throws MigrationException, NotMigrableInSafeModeException Get the list of all curent versions for this component id based on the configuration- Parameters:
componentId
- id to checkconfiguration
- configuration of this version- Returns:
- a non-null list of
Version
. Can be an empty list if no version can be computed (e.g. configuration not filled). Beware, returning an empty list will not initialize the component ; to initialize a component, you need to return a list with a Version with null id. - Throws:
MigrationException
- Something went wrongNotMigrableInSafeModeException
- Impossible to determine the version (e.g. Safe Mode without access to the conf)
-
addVersion
Adds a new version for a component- Parameters:
newVersion
- Version to set- Throws:
MigrationException
- Something went wrong
-