Examples of RemoteRepository


Examples of org.apache.ace.repository.ext.impl.RemoteRepository

    private Preferences m_repositoryPrefs;

    public void login(User user, URL repositoryLocation, String repositoryCustomer, String repositoryName) throws IOException {
        synchronized(m_repositoryLock) {
            // Create our own backup repository
            RemoteRepository remote = new RemoteRepository(repositoryLocation, repositoryCustomer, repositoryName);
            m_repositoryPrefs = getUserPrefs(user, repositoryLocation, repositoryCustomer, repositoryName);
            m_repository = getCachedRepositoryFromPreferences(user, remote);

            // Fill the store with any data that might be available locally
            try {
View Full Code Here

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

    @Before
    public void setUp()
        throws Exception
    {
        RemoteRepository repository =
            createRemoteRepository( "testRemoteLegacyRepo", "Unit Test Remote Legacy Repo",
                                    "http://repo1.maven.org/maven/" );
        repository.setLayout( "legacy" );

        //repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, "legacy" );
        repoContent.setRepository( repository );
    }
View Full Code Here

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

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

    }

    protected RemoteRepositoryContent createRemoteRepositoryContent( String id, String name, String url, String layout )
        throws Exception
    {
        RemoteRepository repo = new RemoteRepository();
        repo.setId( id );
        repo.setName( name );
        repo.setUrl( url );
        repo.setLayout( layout );

        RemoteRepositoryContent repoContent =
            applicationContext.getBean( "remoteRepositoryContent#" + layout, RemoteRepositoryContent.class );
        repoContent.setRepository( repo );
View Full Code Here

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

    public void scheduleDownloadRemote( String repositoryId, boolean now, boolean fullDownload )
        throws DownloadRemoteIndexException
    {
        try
        {
            RemoteRepository remoteRepository = remoteRepositoryAdmin.getRemoteRepository( repositoryId );
            if ( remoteRepository == null )
            {
                log.warn( "ignore scheduleDownloadRemote for repo with id {} as not exists", repositoryId );
                return;
            }
            NetworkProxy networkProxy = null;
            if ( StringUtils.isNotBlank( remoteRepository.getRemoteDownloadNetworkProxyId() ) )
            {
                networkProxy = networkProxyAdmin.getNetworkProxy( remoteRepository.getRemoteDownloadNetworkProxyId() );
                if ( networkProxy == null )
                {
                    log.warn(
                        "your remote repository is configured to download remote index trought a proxy we cannot find id:{}",
                        remoteRepository.getRemoteDownloadNetworkProxyId() );
                }
            }

            DownloadRemoteIndexTaskRequest downloadRemoteIndexTaskRequest =
                new DownloadRemoteIndexTaskRequest().setRemoteRepository( remoteRepository ).setNetworkProxy(
                    networkProxy ).setFullDownload( fullDownload ).setWagonFactory(
                    wagonFactory ).setRemoteRepositoryAdmin( remoteRepositoryAdmin ).setIndexUpdater( indexUpdater );

            if ( now )
            {
                log.info( "schedule download remote index for repository {}", remoteRepository.getId() );
                // do it in async
                taskScheduler.schedule(
                    new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
                    new Date() );
            }
            else
            {
                log.info( "schedule download remote index for repository {} with cron expression {}",
                          remoteRepository.getId(), remoteRepository.getCronExpression() );
                taskScheduler.schedule(
                    new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
                    new CronTrigger( remoteRepository.getCronExpression() ) );

                if ( remoteRepository.isDownloadRemoteIndexOnStartup() )
                {
                    log.info(
                        "remote repository {} configured with downloadRemoteIndexOnStartup schedule now a download",
                        remoteRepository.getId() );
                    taskScheduler.schedule(
                        new DownloadRemoteIndexTask( downloadRemoteIndexTaskRequest, this.runningRemoteDownloadIds ),
                        new Date() );
                }
            }
View Full Code Here

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

            if ( repo != null )
            {
                return repo;
            }

            RemoteRepository repoConfig = remoteRepositoryAdmin.getRemoteRepository( repoId );
            if ( repoConfig == null )
            {
                throw new RepositoryNotFoundException(
                    "Unable to find remote repository configuration for id:" + repoId );
            }

            repo = applicationContext.getBean( "remoteRepositoryContent#" + repoConfig.getLayout(),
                                               RemoteRepositoryContent.class );
            repo.setRepository( repoConfig );
            remoteContentMap.put( repoId, repo );

            return repo;
View Full Code Here

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

    }

    public void testDeleteRemoteRepositoryConfirmation()
        throws Exception
    {
        RemoteRepository originalRepository = createRepository();
        Configuration configuration = createConfigurationForEditing( originalRepository );

        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( configuration );

        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( configuration );

        archivaConfigurationControl.replay();

        action.setRepoid( REPO_ID );

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

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

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

        action.setRepoid( REPO_ID );

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

        assertEquals( 1, configuration.getProxyConnectors().size() );
View Full Code Here

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

    }

    public void testDeleteRemoteRepositoryCancelled()
        throws Exception
    {
        RemoteRepository originalRepository = createRepository();
        Configuration configuration = createConfigurationForEditing( originalRepository );

        archivaConfiguration.getConfiguration();
        archivaConfigurationControl.setReturnValue( configuration, 2 );

        archivaConfiguration.save( configuration );
        archivaConfigurationControl.replay();

        action.setRepoid( REPO_ID );

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

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

        RemoteRepository repository = action.getRepository();
        assertRepositoryEquals( repository, createRepository() );
        assertEquals( Collections.singletonList( originalRepository ),
                      action.getRemoteRepositoryAdmin().getRemoteRepositories() );
    }
View Full Code Here

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

        return configuration;
    }

    private RemoteRepository createRepository()
    {
        RemoteRepository r = new RemoteRepository();
        r.setId( REPO_ID );
        populateRepository( r );
        return r;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.