Class SingleVersionHandler
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.migration.handler.AbstractVersionHandler
org.ametys.core.migration.handler.SingleVersionHandler
- All Implemented Interfaces:
VersionHandler
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Class for
VersionHandler
returning only one version.-
Field Summary
Fields inherited from class org.ametys.core.migration.handler.AbstractVersionHandler
_id, _versionStorage, _versionStorageEP, _versionStorageId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetConfiguration
(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 configurationMethods inherited from class org.ametys.core.migration.handler.AbstractVersionHandler
addVersion, configure, getVersionStorage, service, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
SingleVersionHandler
public SingleVersionHandler()
-
-
Method Details
-
getCurrentVersions
public List<Version> getCurrentVersions(String componentId, VersionConfiguration configuration) throws MigrationException, NotMigrableInSafeModeException Description copied from interface:VersionHandler
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)
-
getConfiguration
public VersionConfiguration getConfiguration(String componentId, Configuration versionConfiguration) throws ConfigurationException, NotMigrableInSafeModeException Description copied from interface:VersionHandler
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)
-