public void initializeExecutors( AbstractPurgeConfiguration purgeConfig )
throws ContinuumPurgeExecutorException
{
RepositoryManagedContent repositoryContent;
RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;
try
{
repositoryContent =
purgeConfigurationService.getManagedRepositoryContent( repoPurge.getRepository().getId() );
}
catch ( PurgeConfigurationServiceException e )
{
throw new ContinuumPurgeExecutorException( "Error while initializing purge executors", e );
}
if ( repoPurge.isDeleteAll() )
{
purgeExecutor = new CleanAllPurgeExecutor( ContinuumPurgeConstants.PURGE_REPOSITORY );
}
else
{
if ( repoPurge.getDaysOlder() > 0 )
{
purgeExecutor = new DaysOldRepositoryPurgeExecutor( repositoryContent, repoPurge.getDaysOlder(),
repoPurge.getRetentionCount() );
}
else
{
purgeExecutor =
new RetentionCountRepositoryPurgeExecutor( repositoryContent, repoPurge.getRetentionCount() );
}
purgeReleasedSnapshotsExecutor = new ReleasedSnapshotsRepositoryPurgeExecutor( repositoryContent );
deleteReleasedSnapshots = repoPurge.isDeleteReleasedSnapshots();
}
}