Package org.ametys.cms.workflow.purge
Class PurgeVersionsManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.workflow.purge.PurgeVersionsManager
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
Component which purges content old versions.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Version information. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<PurgeVersionsManager.VersionInfo>
getAllVersions
(javax.jcr.version.VersionHistory versionHistory) Get all versions of a version history.int
purgeContent
(WorkflowAwareContent content, long validationStepId, int firstVersionsToKeep) Purge a content.protected int
purgeContent
(WorkflowAwareContent content, javax.jcr.version.VersionHistory versionHistory, javax.jcr.version.Version baseVersion, long validationStepId, int firstVersionsToKeep) Purge a content version history.void
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The avalon component role.
-
-
Constructor Details
-
PurgeVersionsManager
public PurgeVersionsManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
purgeContent
public int purgeContent(WorkflowAwareContent content, long validationStepId, int firstVersionsToKeep) Purge a content.- Parameters:
content
- the content to purge.validationStepId
- the ID of the validation step for this content.firstVersionsToKeep
- the count of first versions to keep.- Returns:
- the count of removed versions.
-
purgeContent
protected int purgeContent(WorkflowAwareContent content, javax.jcr.version.VersionHistory versionHistory, javax.jcr.version.Version baseVersion, long validationStepId, int firstVersionsToKeep) throws javax.jcr.RepositoryException Purge a content version history.- Parameters:
content
- the content.versionHistory
- the version history to purge.baseVersion
- the content base version, must be kept.validationStepId
- the ID of the validation step for this content.firstVersionsToKeep
- the count of first versions to keep.- Returns:
- the count of removed versions.
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
getAllVersions
protected List<PurgeVersionsManager.VersionInfo> getAllVersions(javax.jcr.version.VersionHistory versionHistory) throws javax.jcr.RepositoryException Get all versions of a version history.- Parameters:
versionHistory
- the version history to purge.- Returns:
- all the version infos.
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-