Package org.apache.continuum.model.repository

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


                {
                    context.put( ContinuumBuildConstant.KEY_LATEST_UPDATE_DATE,
                                 new Date( buildResult.getStartTime() ) );
                }

                LocalRepository localRepo = project.getProjectGroup().getLocalRepository();               

                if ( localRepo != null )
                {
                    // CONTINUUM-2391
                  context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getName() );                 
                }
                else
                {
                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, "" );
                }
View Full Code Here


        throws ContinuumStoreException
    {
        String name = "testAddProjectGroup";
        String description = "testAddProjectGroup description";
        String groupId = "org.apache.maven.continuum.test";
        LocalRepository repository = localRepositoryDao.getLocalRepository( testLocalRepository3.getId() );
        ProjectGroup group = createTestProjectGroup( name, description, groupId, repository );

        ProjectGroup copy = createTestProjectGroup( group );
        projectGroupDao.addProjectGroup( group );
        copy.setId( group.getId() );
View Full Code Here

    {
        String name = "testAddLocalRepository";
        String directory = "testAddLocalRepositoryDirectory";
        String layout = "default";

        LocalRepository repository = createTestLocalRepository( name, directory, layout );

        LocalRepository copy = createTestLocalRepository( repository );
        localRepositoryDao.addLocalRepository( repository );
        copy.setId( repository.getId() );

        LocalRepository retrievedRepository = localRepositoryDao.getLocalRepository( repository.getId() );
        assertLocalRepositoryEquals( copy, retrievedRepository );
    }
View Full Code Here

    }

    public void testRemoveLocalRepository()
        throws Exception
    {
        LocalRepository repository = localRepositoryDao.getLocalRepositoryByName( testLocalRepository2.getName() );

        ProjectGroup projectGroup = projectGroupDao.getProjectGroupByGroupId( testProjectGroup2.getGroupId() );
        assertLocalRepositoryEquals( testLocalRepository2, projectGroup.getLocalRepository() );
        projectGroup.setLocalRepository( null );

        projectGroupDao.updateProjectGroup( projectGroup );

        projectGroup = projectGroupDao.getProjectGroup( testProjectGroup2.getId() );
        assertNull( "check local repository", projectGroup.getLocalRepository() );

        List<RepositoryPurgeConfiguration> repoPurgeList =
            repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsByLocalRepository( repository.getId() );

        assertEquals( "check # repo purge config", 1, repoPurgeList.size() );
        repositoryPurgeConfigurationDao.removeRepositoryPurgeConfiguration( repoPurgeList.get( 0 ) );
        localRepositoryDao.removeLocalRepository( repository );
View Full Code Here

    }

    public void testAddRepositoryPurgeConfiguration()
        throws Exception
    {
        LocalRepository repository = localRepositoryDao.getLocalRepository( testLocalRepository3.getId() );
        Schedule schedule = scheduleDao.getSchedule( testSchedule1.getId() );

        RepositoryPurgeConfiguration repoPurge =
            createTestRepositoryPurgeConfiguration( true, 2, 100, false, schedule, true, repository );
View Full Code Here

    private TaskQueueManager taskQueueManager;

    public LocalRepository addLocalRepository( LocalRepository localRepository )
        throws RepositoryServiceException
    {
        LocalRepository repository = null;

        try
        {
            List<LocalRepository> repos = getAllLocalRepositories();
            for ( LocalRepository repo : repos )
            {
                if ( repo.getName().equals( localRepository.getName() ) )
                {
                    throw new RepositoryServiceException( "Local repository name must be unique" );
                }

                if ( repo.getLocation().equals( localRepository.getLocation() ) )
                {
                    throw new RepositoryServiceException( "Local repository location must be unique" );
                }
            }

            localRepository.setName( localRepository.getName().trim() );
            localRepository.setLocation( localRepository.getLocation().trim() );

            repository = localRepositoryDao.addLocalRepository( localRepository );

            log.info( "Added new local repository: " + repository.getName() );
        }
        catch ( ContinuumStoreException e )
        {
            throw new RepositoryServiceException( "Unable to add the requested local repository", e );
        }
View Full Code Here

    public void removeLocalRepository( int repositoryId )
        throws RepositoryServiceException
    {
        try
        {
            LocalRepository repository = getLocalRepository( repositoryId );

            if ( taskQueueManager.isRepositoryInUse( repositoryId ) )
            {
                return;
            }

            if ( taskQueueManager.isRepositoryInPurgeQueue( repositoryId ) )
            {
                taskQueueManager.removeRepositoryFromPurgeQueue( repositoryId );
            }

            log.info( "Remove purge configurations of " + repository.getName() );
            removePurgeConfigurationsOfRepository( repositoryId );

            List<ProjectGroup> groups = projectGroupDao.getProjectGroupByRepository( repositoryId );

            for ( ProjectGroup group : groups )
            {
                group.setLocalRepository( null );
                projectGroupDao.updateProjectGroup( group );
            }

            localRepositoryDao.removeLocalRepository( repository );

            log.info( "Removed local repository: " + repository.getName() );
        }
        catch ( TaskQueueManagerException e )
        {
            // swallow?
        }
View Full Code Here

    public void purgeRepository( RepositoryPurgeConfiguration repoPurge )
        throws ContinuumPurgeManagerException
    {
        try
        {
            LocalRepository repository = repoPurge.getRepository();

            // do not purge if repository is in use and if repository is already in purge queue
            if ( !taskQueueManager.isRepositoryInUse( repository.getId() ) &&
                 !taskQueueManager.isInPurgeQueue( repoPurge.getId() ) )
            {
                taskQueueManager.getPurgeQueue().put( new PurgeTask( repoPurge.getId() ) );
            }
        }
View Full Code Here

        projectGroup.setDescription( description );

        // [CONTINUUM-2228]. In select field can't select empty values.
        if ( repositoryId > 0 )
        {
            LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
            projectGroup.setLocalRepository( repository );
        }

        getContinuum().updateProjectGroup( projectGroup );
View Full Code Here

                group.setGroupId( DEFAULT_PROJECT_GROUP_GROUP_ID );

                group.setDescription( "Contains all projects that do not have a group of their own" );

                LocalRepository localRepository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );

                group.setLocalRepository( localRepository );

                group = projectGroupDao.addProjectGroup( group );
View Full Code Here

TOP

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

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.