Package org.apache.continuum.purge

Examples of org.apache.continuum.purge.ContinuumPurgeManager


    }

    public String purge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();

        if ( purgeConfigId > 0 )
        {
            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );

            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 );
            }
            else
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
                purgeManager.purgeDirectory( dirPurge );
            }
        }

        return SUCCESS;
    }
View Full Code Here


    }
   
    public String doPurge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();

        // check if repository is in use
        if ( taskQueueManager.isRepositoryInUse( repository.getId() ) )
        {
            addActionError( getText( "repository.error.purge.in.use", "Unable to purge repository because it is in use" ) );
        }
    
        if ( !hasActionErrors() )
        {
            // get default purge configuration for repository
            RepositoryPurgeConfiguration purgeConfig = purgeConfigService.getDefaultPurgeConfigurationForRepository( repository.getId() );
       
            if ( purgeConfig != null )
            {
                purgeManager.purgeRepository( purgeConfig );

                AuditLog event = new AuditLog( "Repository id=" + repository.getId(), AuditLogConstants.PURGE_LOCAL_REPOSITORY );
                event.setCategory( AuditLogConstants.LOCAL_REPOSITORY );
                event.setCurrentUser( getPrincipal() );
                event.log();
View Full Code Here

        logger.info( ">>>>>>>>>>>>>>>>>>>>> Executing purge job (" + jobName + ")..." );

        Continuum continuum = (Continuum) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.CONTINUUM );

        ContinuumPurgeManager purgeManager = continuum.getPurgeManager();
       
        Schedule schedule = (Schedule) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.SCHEDULE );

        try
        {
            purgeManager.purge( schedule );
        }
        catch ( ContinuumPurgeManagerException e )
        {
            logger.error( "Error purging for job" + jobName + ".", e );
        }
View Full Code Here

    }
   
    public String doPurge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();

        // check if repository is in use
        if ( taskQueueManager.isRepositoryInUse( repository.getId() ) )
        {
            message = "repository.error.purge.in.use";
            return ERROR;
        }
       
        // get default purge configuration for repository
        RepositoryPurgeConfiguration purgeConfig = purgeConfigService.getDefaultPurgeConfigurationForRepository( repository.getId() );
       
        if ( purgeConfig != null )
        {
            purgeManager.purgeRepository( purgeConfig );
        }
       
        return SUCCESS;
    }
View Full Code Here

    }
   
    public String purge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();
       
        if ( purgeConfigId > 0 )
        {
            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
           
            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 );
            }
            else
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
                purgeManager.purgeDirectory( dirPurge );
            }
        }
       
        return SUCCESS;
    }
View Full Code Here

        logger.info( ">>>>>>>>>>>>>>>>>>>>> Executing purge job (" + jobName + ")..." );

        Continuum continuum = (Continuum) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.CONTINUUM );

        ContinuumPurgeManager purgeManager = continuum.getPurgeManager();
       
        Schedule schedule = (Schedule) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.SCHEDULE );

        try
        {
            purgeManager.purge( schedule );
        }
        catch ( ContinuumPurgeManagerException e )
        {
            logger.error( "Error purging for job" + jobName + ".", e );
        }
View Full Code Here

    }
   
    public String doPurge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();

        // check if repository is in use
        if ( taskQueueManager.isRepositoryInUse( repository.getId() ) )
        {
            addActionError( getText( "repository.error.purge.in.use", "Unable to purge repository because it is in use" ) );
        }
    
        if ( !hasActionErrors() )
        {
            // get default purge configuration for repository
            RepositoryPurgeConfiguration purgeConfig = purgeConfigService.getDefaultPurgeConfigurationForRepository( repository.getId() );
       
            if ( purgeConfig != null )
            {
                purgeManager.purgeRepository( purgeConfig );

                AuditLog event = new AuditLog( "Repository id=" + repository.getId(), AuditLogConstants.PURGE_LOCAL_REPOSITORY );
                event.setCategory( AuditLogConstants.LOCAL_REPOSITORY );
                event.setCurrentUser( getPrincipal() );
                event.log();
View Full Code Here

    }

    public String purge()
        throws Exception
    {
        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
        TaskQueueManager taskQueueManager = getContinuum().getTaskQueueManager();

        if ( purgeConfigId > 0 )
        {
            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );

            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 );
            }
            else
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
                purgeManager.purgeDirectory( dirPurge );
            }
        }

        return SUCCESS;
    }
View Full Code Here

    }

    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 );
                }
View Full Code Here

    public String purge()
        throws Exception
    {

        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();

        if ( purgeConfigId > 0 )
        {
            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );

            DistributedDirectoryPurgeConfiguration dirPurge = (DistributedDirectoryPurgeConfiguration) purgeConfig;
            purgeManager.purgeDistributedDirectory( dirPurge );
        }

        return SUCCESS;
    }
View Full Code Here

TOP

Related Classes of org.apache.continuum.purge.ContinuumPurgeManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.