Package org.apache.continuum.model.repository

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


        //todo should be configurable
        File performDirectory = new File( getContinuum().getConfiguration().getWorkingDirectory(),
                                          "releases-" + System.currentTimeMillis() );
        performDirectory.mkdirs();
       
        LocalRepository repository = project.getProjectGroup().getLocalRepository();
       
        releaseManager.perform( releaseId, performDirectory, goals, useReleaseProfile, listener, repository );

        return SUCCESS;
    }
View Full Code Here


                context.put( ContinuumBuildConstant.KEY_PROJECT_NAME, project.getName() );
                context.put( ContinuumBuildConstant.KEY_EXECUTOR_ID, project.getExecutorId() );
                context.put( ContinuumBuildConstant.KEY_SCM_URL, project.getScmUrl() );
                context.put( ContinuumBuildConstant.KEY_PROJECT_STATE, new Integer( project.getState() ) );

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

                if ( localRepo != null )
                {
                    context.put( ContinuumBuildConstant.KEY_LOCAL_REPOSITORY, localRepo.getLocation() );
                }
                else
                {
                    context.put( ContinuumBuildConstant.KEY_LOCAL_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

        projectGroup.setDescription( description );

        if ( repositoryId > 0 )
        {
            LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
            projectGroup.setLocalRepository( repository );
        }
        else
        {
            projectGroup.setLocalRepository( null );
View Full Code Here

        // Local Repository
        // ----------------------------------------------------------------------

        try
        {
            LocalRepository repository = localRepositoryDao.getLocalRepositoryByName( "DEFAULT" );

            projectGroup.setLocalRepository( repository );
        }
        catch ( ContinuumStoreException e )
        {
View Full Code Here

        throws Exception
    {
        Continuum continuum = getContinuum();
        RepositoryService service = (RepositoryService) lookup( RepositoryService.ROLE );
       
        LocalRepository repository = new LocalRepository();
        repository.setName( "defaultRepo" );
        repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
        repository = service.addLocalRepository( repository );
       
        ProjectGroup group = new ProjectGroup();
        group.setGroupId( "testGroup" );
        group.setName( "testGroup" );
        group.setLocalRepository( repository );
        continuum.addProjectGroup( group );
       
        ProjectGroup retrievedDefaultProjectGroup = continuum
        .getProjectGroupByGroupId( "testGroup" );
        assertNotNull( retrievedDefaultProjectGroup.getLocalRepository() );
       
        continuum.removeProjectGroup( retrievedDefaultProjectGroup.getId() );
       
        try
        {
            continuum.getProjectGroupByGroupId( "testGroup" );
            fail( "project group was not deleted" );
        }
        catch ( Exception e )
        {
            // should fail. do nothing.
        }
       
        LocalRepository retrievedRepository = service.getLocalRepository( repository.getId() );
        assertNotNull( retrievedRepository );
        assertEquals( repository, retrievedRepository );
    }
View Full Code Here

       
        try
        {
            if ( repositoryId > 0 )
            {
                LocalRepository repository = getContinuum().getRepositoryService().getLocalRepository( repositoryId );
                projectGroup.setLocalRepository( repository );
            }
        }
        catch ( RepositoryServiceException e )
        {
View Full Code Here

                List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
                                                                       workingDirectoryService.getWorkingDirectory(
                                                                           project ), buildDefinition );

                LocalRepository repository = project.getProjectGroup().getLocalRepository();
               
                builderHelper.setLocalRepository( repository );
               
                ArtifactRepository localRepository = builderHelper.getLocalRepository();
               
View Full Code Here

    public RepositoryManagedContent getManagedRepositoryContent( int repositoryId )
        throws PurgeConfigurationServiceException
    {
        try
        {
            LocalRepository repository = localRepositoryDao.getLocalRepository( repositoryId );

            RepositoryManagedContent repoContent;

            repoContent =
                (RepositoryManagedContent) container.lookup( RepositoryManagedContent.class, repository.getLayout() );
            repoContent.setRepository( repository );

            return repoContent;
        }
        catch ( ContinuumObjectNotFoundException e )
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.