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
public class SingleVersionHandler extends AbstractVersionHandler
Class forVersionHandlerreturning only one version.
-
-
Field Summary
-
Fields inherited from class org.ametys.core.migration.handler.AbstractVersionHandler
_id, _versionStorage, _versionStorageEP, _versionStorageId
-
-
Constructor Summary
Constructors Constructor Description SingleVersionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionConfigurationgetConfiguration(String componentId, Configuration versionConfiguration)Create a specific object containing usefull data for the handler/storageList<Version>getCurrentVersions(String componentId, VersionConfiguration configuration)Get the list of all curent versions for this component id based on the configuration-
Methods 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 Detail
-
SingleVersionHandler
public SingleVersionHandler()
-
-
Method Detail
-
getCurrentVersions
public List<Version> getCurrentVersions(String componentId, VersionConfiguration configuration) throws MigrationException, NotMigrableInSafeModeException
Description copied from interface:VersionHandlerGet 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:VersionHandlerCreate 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)
-
-