Class JavaVersionHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.migration.handler.impl.JavaVersionHandler
-
- All Implemented Interfaces:
VersionHandler
,LogEnabled
,Serviceable
public class JavaVersionHandler extends AbstractLogEnabled implements VersionHandler, Serviceable
Version Handler which use a java class as version storage
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager
_manager
Service Manager
-
Constructor Summary
Constructors Constructor Description JavaVersionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVersion(Version newVersion)
Adds a new version for a componentVersionConfiguration
getConfiguration(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 configurationvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
Service Manager
-
-
Constructor Detail
-
JavaVersionHandler
public JavaVersionHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
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- Specified by:
getCurrentVersions
in interfaceVersionHandler
- 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
public void addVersion(Version newVersion) throws MigrationException
Description copied from interface:VersionHandler
Adds a new version for a component- Specified by:
addVersion
in interfaceVersionHandler
- Parameters:
newVersion
- Version to set- Throws:
MigrationException
- Something went wrong
-
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- Specified by:
getConfiguration
in interfaceVersionHandler
- 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)
-
-