Class StorageBasedVersionHandler
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.migration.version.handler.StorageBasedVersionHandler
- All Implemented Interfaces:
VersionHandler
,LogEnabled
,Configurable
,Serviceable
public class StorageBasedVersionHandler
extends AbstractLogEnabled
implements VersionHandler, Serviceable, Configurable
Class for
VersionHandler
delegating to a single VersionStorage
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) createVersionConfiguration
(Configuration versionConfiguration) Creates aVersionConfiguration
associated with thisVersionHandler
getVersions
(MigrationEngine.MigrationComponent component) Retrieves a hierarchical view of allVersion
managed by this component.getVersionStorage
(VersionConfiguration configuration) Returns theVersionStorage
associated with thisVersionHandler
.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
StorageBasedVersionHandler
public StorageBasedVersionHandler()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getVersionStorage
public VersionStorage getVersionStorage(VersionConfiguration configuration) throws MigrationException Description copied from interface:VersionHandler
Returns theVersionStorage
associated with thisVersionHandler
.- Specified by:
getVersionStorage
in interfaceVersionHandler
- Parameters:
configuration
- the associated configuration- Returns:
- the associated
VersionStorage
- Throws:
MigrationException
- if an exception occur while getting the version storage
-
getVersions
public MigrationEngine.Versions getVersions(MigrationEngine.MigrationComponent component) throws MigrationException Description copied from interface:VersionHandler
Retrieves a hierarchical view of allVersion
managed by this component.- Specified by:
getVersions
in interfaceVersionHandler
- Parameters:
component
- the context component- Returns:
- all
Version
managed by this component - Throws:
MigrationException
- something went wrong while retrieveing the versions
-
createVersionConfiguration
public VersionConfiguration createVersionConfiguration(Configuration versionConfiguration) throws ConfigurationException, NotMigrableInSafeModeException Description copied from interface:VersionHandler
Creates aVersionConfiguration
associated with thisVersionHandler
- Specified by:
createVersionConfiguration
in interfaceVersionHandler
- Parameters:
versionConfiguration
- theConfiguration
for retrieving versions- Returns:
- a configuration for this type of version handler
- Throws:
ConfigurationException
- something is wrong in the configurationNotMigrableInSafeModeException
- if it's impossible to configure the versions in safe mode
-