Package org.apache.continuum.model.repository

Examples of org.apache.continuum.model.repository.RepositoryPurgeConfiguration


    }

    public RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
        throws PurgeConfigurationServiceException
    {
        RepositoryPurgeConfiguration repoPurgeConfig;

        try
        {
            repoPurgeConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
        }
View Full Code Here


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

        try
        {
            if ( purgeConfig != null && purgeConfig instanceof RepositoryPurgeConfiguration )
            {
                RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;

                LocalRepository repository = repoPurge.getRepository();

                if ( repository == null )
                {
                    throw new TaskExecutionException(
                        "Error while executing purge repository task: no repository set" );
                }

                PurgeController purgeController =
                    (PurgeController) container.lookup( PurgeController.ROLE, "purge-repository" );

                purgeController.initializeExecutors( repoPurge );

                if ( repoPurge.isDeleteAll() )
                {
                    purgeController.doPurge( repository.getLocation() );
                }
                else
                {
View Full Code Here

        LocalRepository repository = new LocalRepository();
        repository.setName( "defaultRepo" );
        repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
        repository = localRepositoryDao.addLocalRepository( repository );

        repoPurge = new RepositoryPurgeConfiguration();
        repoPurge.setRepository( repository );
        repoPurge = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );

        dirPurge = new DirectoryPurgeConfiguration();
        dirPurge.setDirectoryType( "releases" );
View Full Code Here

        ProjectGroup group = getDefaultProjectGroup();
        group.setLocalRepository( repository );
        getProjectGroupDao().updateProjectGroup( group );

        RepositoryPurgeConfiguration repoConfig = new RepositoryPurgeConfiguration();
        repoConfig.setRepository( repository );
        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );

        List<LocalRepository> repositories = repositoryService.getAllLocalRepositories();
        assertEquals( "check # repositories", 1, repositories.size() );
        assertTrue( "check if repository was added", repositories.contains( repository ) );
View Full Code Here

    }

    public void testRepositoryPurgeConfiguration()
        throws Exception
    {
        RepositoryPurgeConfiguration repoConfig = new RepositoryPurgeConfiguration();

        repoConfig.setRepository( defaultRepository );
        repoConfig.setDaysOlder( TEST_DAYS_OLDER );
        repoConfig.setRetentionCount( TEST_RETENTION_COUNT );

        repoConfig = purgeConfigurationService.addRepositoryPurgeConfiguration( repoConfig );

        assertNotNull( repoConfig );

        RepositoryPurgeConfiguration retrieved =
            repositoryPurgeConfigurationDao.getRepositoryPurgeConfiguration( repoConfig.getId() );
        assertEquals( repoConfig, retrieved );

        purgeConfigurationService.removeRepositoryPurgeConfiguration( repoConfig );
View Full Code Here

    }

    private void createDefaultRepoPurgeConfiguration()
        throws Exception
    {
        RepositoryPurgeConfiguration repoPurge = new RepositoryPurgeConfiguration();

        repoPurge.setRepository( defaultRepository );
        repoPurge.setDeleteAll( true );

        defaultRepoPurge = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
    }
View Full Code Here

    }

    protected PurgeTask getDaysOldRepoPurgeTask()
        throws Exception
    {
        repoConfig = new RepositoryPurgeConfiguration();
        repoConfig.setRepository( defaultRepository );
        repoConfig.setDaysOlder( TEST_DAYS_OLDER );
        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );

        return new PurgeTask( repoConfig.getId() );
View Full Code Here

    }

    protected PurgeTask getRetentionCountRepoPurgeTask()
        throws Exception
    {
        repoConfig = new RepositoryPurgeConfiguration();
        repoConfig.setRepository( defaultRepository );
        repoConfig.setDaysOlder( -1 );
        repoConfig.setRetentionCount( TEST_RETENTION_COUNT );
        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );
View Full Code Here

    }

    protected PurgeTask getReleasedSnapshotsRepoPurgeTask()
        throws Exception
    {
        repoConfig = new RepositoryPurgeConfiguration();
        repoConfig.setRepository( defaultRepository );
        repoConfig.setDaysOlder( -1 );
        repoConfig.setRetentionCount( TEST_RETENTION_COUNT );
        repoConfig.setDeleteReleasedSnapshots( true );
        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );
View Full Code Here

TOP

Related Classes of org.apache.continuum.model.repository.RepositoryPurgeConfiguration

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.