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

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


        return repo;
    }

    protected RemoteRepository createRemoteRepository( String id, String name, String url )
    {
        RemoteRepository repo = new RemoteRepository();
        repo.setId( id );
        repo.setName( name );
        repo.setUrl( url );
        return repo;
    }
View Full Code Here


    {
        List<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>(
            getArchivaConfiguration().getConfiguration().getRemoteRepositories().size() );
        for ( RemoteRepositoryConfiguration repositoryConfiguration : getArchivaConfiguration().getConfiguration().getRemoteRepositories() )
        {
            RemoteRepository remoteRepository =
                new RemoteRepository( repositoryConfiguration.getId(), repositoryConfiguration.getName(),
                                      repositoryConfiguration.getUrl(), repositoryConfiguration.getLayout(),
                                      repositoryConfiguration.getUsername(), repositoryConfiguration.getPassword(),
                                      repositoryConfiguration.getTimeout() );
            remoteRepository.setDownloadRemoteIndex( repositoryConfiguration.isDownloadRemoteIndex() );
            remoteRepository.setRemoteIndexUrl( repositoryConfiguration.getRemoteIndexUrl() );
            remoteRepository.setCronExpression( repositoryConfiguration.getRefreshCronExpression() );
            remoteRepository.setIndexDirectory( repositoryConfiguration.getIndexDir() );
            remoteRepository.setRemoteDownloadNetworkProxyId(
                repositoryConfiguration.getRemoteDownloadNetworkProxyId() );
            remoteRepository.setRemoteDownloadTimeout( repositoryConfiguration.getRemoteDownloadTimeout() );
            remoteRepository.setDownloadRemoteIndexOnStartup(
                repositoryConfiguration.isDownloadRemoteIndexOnStartup() );
            remoteRepository.setDescription( repositoryConfiguration.getDescription() );
            remoteRepositories.add( remoteRepository );
        }
        return remoteRepositories;
    }
View Full Code Here

            managedRepositoriesService.deleteManagedRepository( id, false );
        }

        getManagedRepositoriesService().addManagedRepository( managedRepository );

        RemoteRepository remoteRepository = new RemoteRepository();
        remoteRepository.setId( "all-merged" );
        remoteRepository.setName( "all-merged" );
        remoteRepository.setDownloadRemoteIndex( true );
        remoteRepository.setUrl( "http://localhost:" + port + "/repository/test-group" );
        remoteRepository.setRemoteIndexUrl( "http://localhost:" + port + "/repository/test-group/.indexer" );
        remoteRepository.setUserName( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME );
        remoteRepository.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD );

        getRemoteRepositoriesService().addRemoteRepository( remoteRepository );

        ProxyConnectorService proxyConnectorService = getProxyConnectorService();
        ProxyConnector proxyConnector = new ProxyConnector();
View Full Code Here

    private RemoteRepository repository;

    public void prepare()
        throws RepositoryAdminException
    {
        this.repository = new RemoteRepository();
        setNetworkProxies( getNetworkProxyAdmin().getNetworkProxies() );
    }
View Full Code Here

    @Test
    public void downloadWithRemoteRedirect()
        throws Exception
    {
        RemoteRepository remoteRepository = getRemoteRepositoriesService().getRemoteRepository( "central" );
        remoteRepository.setUrl( "http://localhost:" + redirectPort );
        getRemoteRepositoriesService().updateRemoteRepository( remoteRepository );

        RoleManagementService roleManagementService = getRoleManagementService( authorizationHeader );

        if ( !roleManagementService.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER,
View Full Code Here

    }

    public String delete()
    {
        String result = SUCCESS;
        RemoteRepository existingRepository = repository;
        if ( existingRepository == null )
        {
            addActionError( "A repository with that id does not exist" );
            return ERROR;
        }

        try
        {
            getRemoteRepositoryAdmin().deleteRemoteRepository( existingRepository.getId(), getAuditInformation() );
        }
        catch ( RepositoryAdminException e )
        {
            addActionError( "RepositoryAdminException: " + e.getMessage() );
            result = ERROR;
View Full Code Here

        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( new Configuration() );
        archivaConfigurationControl.replay();

        action.prepare();
        RemoteRepository configuration = action.getRepository();
        assertNotNull( configuration );
        assertNull( configuration.getId() );

        String status = action.input();
        assertEquals( Action.INPUT, status );
    }
View Full Code Here

        archivaConfigurationControl.setReturnValue( configuration, 1 );

        archivaConfigurationControl.replay();

        action.prepare();
        RemoteRepository repository = action.getRepository();
        populateRepository( repository );

        assertEquals( "url ", repository.getUrl() );

        String status = action.commit();
        assertEquals( Action.SUCCESS, status );

        assertEquals( Collections.singletonList( repository ),
                      action.getRemoteRepositoryAdmin().getRemoteRepositories() );

        assertEquals( "url", repository.getUrl() );

        archivaConfigurationControl.verify();
    }
View Full Code Here

        action.setRepoid( REPO_ID );
        action.prepare();

        assertEquals( REPO_ID, action.getRepoid() );
        RemoteRepository repository = action.getRepository();
        populateRepository( repository );
        repository.setName( "new repo name" );

        String status = action.commit();
        assertEquals( Action.SUCCESS, status );

        RemoteRepository newRepository = createRepository();
        newRepository.setName( "new repo name" );
        assertRepositoryEquals( repository, newRepository );
        assertEquals( Collections.singletonList( repository ),
                      action.getRemoteRepositoryAdmin().getRemoteRepositories() );

        archivaConfigurationControl.verify();
View Full Code Here

        action.setRepoid( REPO_ID );

        action.prepare();
        assertEquals( REPO_ID, action.getRepoid() );
        RemoteRepository repository = action.getRepository();
        assertNotNull( repository );
        assertRepositoryEquals( repository, createRepository() );

        String status = action.input();
        assertEquals( Action.INPUT, status );
View Full Code Here

TOP

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

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.