Class JcrDataVersionStorage
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.repository.migration.jcr.data.JcrDataVersionStorage
- All Implemented Interfaces:
VersionStorage
,LogEnabled
,Serviceable
public class JcrDataVersionStorage
extends AbstractLogEnabled
implements VersionStorage, Serviceable
JCR implementation of
VersionStorage
, to manage the list of versions in a repository-
Field Summary
Modifier and TypeFieldDescriptionprotected MigrationExtensionPoint
The migration extension pointprotected AmetysObjectResolver
The Ametys object resolverprotected VersionsRootHelper
The versions root helper -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVersion
(Version version) Add a versiongetAllVersions
(String componentIdentifier, VersionConfiguration configuration, String versionHandlerId) Get the history of all versions for a component identifiergetConfiguration
(String componentId, Configuration versionConfiguration) Create a specific object containing usefull data for the handler/storagegetCurrentVersion
(String componentIdentifier, VersionConfiguration configuration, String versionHandlerId) Find the current version for a component identifiervoid
removeAllVersions
(String componentIdentifier, VersionConfiguration configuration) Remove all versions for a component identifiervoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_resolver
The Ametys object resolver -
_migrationEP
The migration extension point -
_versionsRootHelper
The versions root helper
-
-
Constructor Details
-
JcrDataVersionStorage
public JcrDataVersionStorage()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getCurrentVersion
public Version getCurrentVersion(String componentIdentifier, VersionConfiguration configuration, String versionHandlerId) throws MigrationException Description copied from interface:VersionStorage
Find the current version for a component identifier- Specified by:
getCurrentVersion
in interfaceVersionStorage
- Parameters:
componentIdentifier
- component to look forconfiguration
- configuration to useversionHandlerId
- id of theVersionHandler
- Returns:
- the current version for this component (can have a versionId null if no version is found), or null if it is impossible to determine the version (e.g. safe mode).
- Throws:
MigrationException
- Something went wrongNotMigrableInSafeModeException
- Impossible to determine the version
-
getAllVersions
public List<Version> getAllVersions(String componentIdentifier, VersionConfiguration configuration, String versionHandlerId) throws MigrationException Description copied from interface:VersionStorage
Get the history of all versions for a component identifier- Specified by:
getAllVersions
in interfaceVersionStorage
- Parameters:
componentIdentifier
- component to look forconfiguration
- configuration to useversionHandlerId
- id of theVersionHandler
- Returns:
- list of all versions for this component
- Throws:
MigrationException
- Something went wrongNotMigrableInSafeModeException
- Impossible to determine the version
-
addVersion
Description copied from interface:VersionStorage
Add a version- Specified by:
addVersion
in interfaceVersionStorage
- Parameters:
version
- Version to store (contains the component identifier)- Throws:
MigrationException
- Something went wrong
-
removeAllVersions
public void removeAllVersions(String componentIdentifier, VersionConfiguration configuration) throws MigrationException Description copied from interface:VersionStorage
Remove all versions for a component identifier- Specified by:
removeAllVersions
in interfaceVersionStorage
- Parameters:
componentIdentifier
- component to clearconfiguration
- configuration to use- Throws:
MigrationException
- Something went wrong
-
getConfiguration
public VersionConfiguration getConfiguration(String componentId, Configuration versionConfiguration) throws ConfigurationException Description copied from interface:VersionStorage
Create a specific object containing usefull data for the handler/storage- Specified by:
getConfiguration
in interfaceVersionStorage
- Parameters:
componentId
- id of the componentversionConfiguration
- configuration from the plugin.xml- Returns:
- the confuguration object
- Throws:
ConfigurationException
- something wrong in the configuration
-