}
public String purge()
throws Exception
{
ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();
if ( purgeConfigId > 0 )
{
purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
AuditLog event;
if ( purgeConfig instanceof RepositoryPurgeConfiguration )
{
RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;
// check if repository is in use
if ( taskQueueManager.isRepositoryInUse( repoPurge.getRepository().getId() ) )
{
message = "repository.error.purge.in.use";
return ERROR;
}
purgeManager.purgeRepository( repoPurge );
event = new AuditLog( repoPurge.getRepository().getName(), AuditLogConstants.PURGE_LOCAL_REPOSITORY );
event.setCategory( AuditLogConstants.LOCAL_REPOSITORY );
}
else
{
DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
purgeManager.purgeDirectory( dirPurge );
if ( dirPurge.getDirectoryType().equals( PURGE_DIRECTORY_RELEASES ) )
{
event = new AuditLog( dirPurge.getLocation(), AuditLogConstants.PURGE_DIRECTORY_RELEASES );
}