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

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


        if ( repositoryGroupService.getRepositoryGroup( repoGroupId ) != null )
        {
            repositoryGroupService.deleteRepositoryGroup( repoGroupId );
        }

        RepositoryGroup repositoryGroup = new RepositoryGroup();
        repositoryGroup.setId( repoGroupId );
        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


        if ( repositoryGroupService.getRepositoryGroup( repoGroupId ) != null )
        {
            repositoryGroupService.deleteRepositoryGroup( repoGroupId );
        }

        RepositoryGroup repositoryGroup = new RepositoryGroup();
        repositoryGroup.setId( repoGroupId );
        String path = ".fooooo";
        repositoryGroup.setRepositories( Arrays.asList( id ) );
        repositoryGroup.setMergedIndexPath( path );

        repositoryGroupService.addRepositoryGroup( repositoryGroup );

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

        {
            defaultManagedRepositoryAdmin.addManagedRepository(
                createManagedRepository( INTERNAL_REPO, new File( "target/test-classes/" + INTERNAL_REPO ).getPath(),
                                         "default" ), false, null );
        }
        RepositoryGroup repoGroupConfig = new RepositoryGroup();
        repoGroupConfig.setId( LOCAL_REPO_GROUP );
        repoGroupConfig.addRepository( RELEASES_REPO );
        repoGroupConfig.addRepository( INTERNAL_REPO );

        defaultRepositoryGroupAdmin.setArchivaConfiguration( archivaConfiguration );
        if ( defaultManagedRepositoryAdmin.getManagedRepository( LOCAL_REPO_GROUP ) == null )
        {
            defaultRepositoryGroupAdmin.addRepositoryGroup( repoGroupConfig, null );
View Full Code Here

            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );

            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );

            RepositoryGroup repositoryGroup =
                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );

            mockAuditListener.clearEvents();

            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
View Full Code Here

            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );

            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );

            RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) )
                    .mergedIndexTtl( 20 ).mergedIndexPath( "/.nonDefaultPath" );

            mockAuditListener.clearEvents();

            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );

            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
            assertEquals( Arrays.asList( "test-new-one" ),
                          repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
            assertEquals( 20, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
            assertEquals( "/.nonDefaultPath", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );

            repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
            assertNotNull( repositoryGroup );

            repositoryGroup.addRepository( managedRepositoryTwo.getId() );

            repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );

            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
View Full Code Here

            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );

            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );

            RepositoryGroup repositoryGroup =
                new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );

            mockAuditListener.clearEvents();

            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
View Full Code Here

            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );

            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );

            RepositoryGroup repositoryGroup =
                    new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) )
                    .mergedIndexTtl( -1 );

            mockAuditListener.clearEvents();

            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
View Full Code Here

            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );

            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );

            RepositoryGroup repositoryGroup =
                    new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );

            mockAuditListener.clearEvents();

            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );

            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
                    repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );

            // verify if default values were saved
            assertEquals(30, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
            assertEquals("/.indexer", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );

            repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
            assertNotNull( repositoryGroup );

            repositoryGroup.mergedIndexTtl( -1 );

            repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
        }
        finally
        {
View Full Code Here

        List<RepositoryGroup> repositoriesGroups =
            new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryGroups().size() );

        for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
        {
            repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList<String>(
                repositoryGroupConfiguration.getRepositories() ) ).mergedIndexPath(
                repositoryGroupConfiguration.getMergedIndexPath() ).mergedIndexTtl(
                repositoryGroupConfiguration.getMergedIndexTtl() ).cronExpression(
                repositoryGroupConfiguration.getCronExpression() ) );
        }
View Full Code Here

    {
        Configuration configuration = getArchivaConfiguration().getConfiguration();
        RepositoryGroupConfiguration repositoryGroupConfiguration =
            configuration.getRepositoryGroupsAsMap().get( repositoryGroupId );
        mergedRemoteIndexesScheduler.unschedule(
            new RepositoryGroup( repositoryGroupId, Collections.<String>emptyList() ) );
        if ( repositoryGroupConfiguration == null )
        {
            throw new RepositoryAdminException(
                "repositoryGroup with id " + repositoryGroupId + " doesn't not exists so cannot remove" );
        }
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.