Class DataStoreGarbageCollectorTask
java.lang.Object
org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
org.ametys.workspaces.repository.maintenance.DataStoreGarbageCollectorTask
- All Implemented Interfaces:
LogEnabled
,MarkEventListener
public class DataStoreGarbageCollectorTask
extends AbstractMaintenanceTask
implements MarkEventListener
DataStoreGarbageCollectorTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.jcr.Session
The JCR Session bound to this task.Fields inherited from class org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
_logger, _progress
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataSource
Retrieve the data source of a data store.protected void
apply()
Apply the tasks (within the execute method()).void
beforeScanning
(javax.jcr.Node n) protected void
close()
Close the tasksstatic void
derbyCompressTable
(DataSource dataSource, String table, Logger logger) Reclaiming unused space.protected void
Initialize the tasks.protected void
Set the tasks logger.Methods inherited from class org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
_getFormattedDuration, createRepository, createRepositoryContext, execute, getAllPersistenceManager, getOrCreateRepository, getOrCreateRepositoryContext, getProgressInfo, getRepository, getRepositoryConfig, isFinished, requiresOffline, setLogger
-
Field Details
-
_session
The JCR Session bound to this task.
-
-
Constructor Details
-
DataStoreGarbageCollectorTask
public DataStoreGarbageCollectorTask()
-
-
Method Details
-
initialize
Description copied from class:AbstractMaintenanceTask
Initialize the tasks. This method can also create theTaskProgress
object bounded to the task.- Overrides:
initialize
in classAbstractMaintenanceTask
- Throws:
javax.jcr.RepositoryException
- If a repository exception
-
setLogger
Description copied from class:AbstractMaintenanceTask
Set the tasks logger.- Specified by:
setLogger
in classAbstractMaintenanceTask
-
apply
Description copied from class:AbstractMaintenanceTask
Apply the tasks (within the execute method()).- Specified by:
apply
in classAbstractMaintenanceTask
- Throws:
javax.jcr.RepositoryException
- If a repository exception
-
close
Description copied from class:AbstractMaintenanceTask
Close the tasks- Overrides:
close
in classAbstractMaintenanceTask
-
_getDataSource
Retrieve the data source of a data store.- Parameters:
ds
- the data store- Returns:
- the data source
- Throws:
javax.jcr.RepositoryException
- when an error occurred
-
derbyCompressTable
Reclaiming unused space. This is derby specific. By default, Derby does not return unused space to the operating system when updating or deleting data.- Parameters:
dataSource
- the data source to compresstable
- the table to compresslogger
- the logger to use for error
-
beforeScanning
- Specified by:
beforeScanning
in interfaceMarkEventListener
- Throws:
javax.jcr.RepositoryException
-