Package org.apache.archiva.admin.model.beans

Examples of org.apache.archiva.admin.model.beans.RepositoryGroup


            timeout -= 500;
        }

        RepositoryGroupService repositoryGroupService = getRepositoryGroupService();

        RepositoryGroup repositoryGroup = new RepositoryGroup();
        repositoryGroup.setId( "test-group" );
        repositoryGroup.setRepositories( Arrays.asList( id ) );

        repositoryGroupService.addRepositoryGroup( repositoryGroup );

        // create a repo with a remote on the one with index
        id = Long.toString( System.currentTimeMillis() );
View Full Code Here


    public String delete()
    {

        try
        {
            RepositoryGroup group = repositoryGroupAdmin.getRepositoryGroup( repoGroupId );
            if ( group == null )
            {
                addActionError( "A repository group with that id does not exist." );
                return ERROR;
            }
View Full Code Here

        action.setRepoGroupId( REPO_GROUP_ID );

        action.prepare();
        assertEquals( REPO_GROUP_ID, action.getRepoGroupId() );
        RepositoryGroup repoGroup = action.getRepositoryGroup();
        assertNotNull( repoGroup );
        assertEquals( repoGroup.getId(), action.getRepoGroupId() );
        assertEquals( Collections.singletonList( origRepoGroup ), configuration.getRepositoryGroups() );
    }
View Full Code Here

        action.setRepoGroupId( REPO_GROUP_ID );

        action.prepare();
        assertEquals( REPO_GROUP_ID, action.getRepoGroupId() );
        RepositoryGroup repoGroup = action.getRepositoryGroup();
        assertNotNull( repoGroup );
        assertEquals( Collections.singletonList( repoGroup ),
                      action.getRepositoryGroupAdmin().getRepositoriesGroups() );

        String status = action.delete();
View Full Code Here

        action.setRepoGroupId( REPO_GROUP_ID );

        action.prepare();
        assertEquals( REPO_GROUP_ID, action.getRepoGroupId() );
        RepositoryGroup repoGroup = action.getRepositoryGroup();
        assertNotNull( repoGroup );

        String status = action.execute();
        assertEquals( Action.SUCCESS, status );
        assertEquals( Collections.singletonList( repoGroup ),
View Full Code Here

    {
        List<RepositoryGroup> repositoriesGroups = new ArrayList<RepositoryGroup>();

        for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
        {
            repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList<String>(
                repositoryGroupConfiguration.getRepositories() ) ) );
        }

        return repositoriesGroups;
    }
View Full Code Here

    public Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId,
                                         AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
        if ( repositoryGroup == null )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot add repository to it" );
        }

        if ( repositoryGroup.getRepositories().contains( repositoryId ) )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " already contain repository with id" + repositoryId );
        }
        validateManagedRepositoriesExists( Arrays.asList( repositoryId ) );

        repositoryGroup.addRepository( repositoryId );
        updateRepositoryGroup( repositoryGroup, auditInformation, false );
        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.ADD_REPO_TO_GROUP, auditInformation );
        return Boolean.TRUE;
    }
View Full Code Here

    public Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId,
                                              AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        RepositoryGroup repositoryGroup = getRepositoryGroup( repositoryGroupId );
        if ( repositoryGroup == null )
        {
            throw new RepositoryAdminException( "repositoryGroup with id " + repositoryGroupId
                                                    + " doesn't not exists so cannot remove repository from it" );
        }

        if ( !repositoryGroup.getRepositories().contains( repositoryId ) )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not contains repository with id"
                    + repositoryId );
        }

        repositoryGroup.removeRepository( repositoryId );
        updateRepositoryGroup( repositoryGroup, auditInformation, false );
        triggerAuditEvent( repositoryGroup.getId(), null, AuditEvent.DELETE_REPO_FROM_GROUP, auditInformation );
        return Boolean.TRUE;
    }
View Full Code Here

        {
            List<RepositoryGroup> repositoriesGroups =
                new ArrayList<>( repositoryGroupAdmin.getRepositoriesGroups().size() );
            for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
            {
                repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<>(
                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
                    repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ) );
            }
            return repositoriesGroups;
        }
View Full Code Here

        ManagedRepository managedRepository = getTestManagedRepository();

        managedRepositoriesService.addManagedRepository( managedRepository );

        RepositoryGroup repositoryGroup = new RepositoryGroup( "one", Arrays.asList( managedRepository.getId() ) )
                .mergedIndexTtl( 40 );

        service.addRepositoryGroup( repositoryGroup );
        assertFalse( service.getRepositoriesGroups().isEmpty() );
        assertEquals( 1, service.getRepositoriesGroups().size() );
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.beans.RepositoryGroup

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.