Package org.apache.archiva.configuration

Examples of org.apache.archiva.configuration.RepositoryScanningConfiguration


        {
            LegacyArtifactPath v = readLegacyArtifactPath( "", (Registry) i.next() );
            legacyArtifactPaths.add( v );
        }
        value.setLegacyArtifactPaths( legacyArtifactPaths );
        RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration( prefix + "repositoryScanning.", registry );
        value.setRepositoryScanning( repositoryScanning );
        WebappConfiguration webapp = readWebappConfiguration( prefix + "webapp.", registry );
        value.setWebapp( webapp );
        OrganisationInformation organisationInfo = readOrganisationInformation( prefix + "organisationInfo.", registry );
        value.setOrganisationInfo( organisationInfo );
View Full Code Here


        return value;
    }
   
    private RepositoryScanningConfiguration readRepositoryScanningConfiguration( String prefix, Registry registry )
    {
        RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();

        java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
        List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" );
        for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); )
        {
            FileType v = readFileType( "", (Registry) i.next() );
            fileTypes.add( v );
        }
        value.setFileTypes( fileTypes );
        java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
        knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) );
        value.setKnownContentConsumers( knownContentConsumers );
        java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
        invalidContentConsumers.addAll( registry.getList( prefix + "invalidContentConsumers.invalidContentConsumer" ) );
        value.setInvalidContentConsumers( invalidContentConsumers );

        return value;
    }
View Full Code Here

        {
            LegacyArtifactPath v = readLegacyArtifactPath( "", (Registry) i.next() );
            legacyArtifactPaths.add( v );
        }
        value.setLegacyArtifactPaths( legacyArtifactPaths );
        RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration( prefix + "repositoryScanning.", registry );
        value.setRepositoryScanning( repositoryScanning );
        WebappConfiguration webapp = readWebappConfiguration( prefix + "webapp.", registry );
        value.setWebapp( webapp );
        OrganisationInformation organisationInfo = readOrganisationInformation( prefix + "organisationInfo.", registry );
        value.setOrganisationInfo( organisationInfo );
View Full Code Here

        return value;
    }
   
    private RepositoryScanningConfiguration readRepositoryScanningConfiguration( String prefix, Registry registry )
    {
        RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();

        java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
        List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" );
        for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); )
        {
            FileType v = readFileType( "", (Registry) i.next() );
            fileTypes.add( v );
        }
        value.setFileTypes( fileTypes );
        java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
        knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) );
        value.setKnownContentConsumers( knownContentConsumers );
        java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
        invalidContentConsumers.addAll( registry.getList( prefix + "invalidContentConsumers.invalidContentConsumer" ) );
        value.setInvalidContentConsumers( invalidContentConsumers );

        return value;
    }
View Full Code Here

    @PostConstruct
    public void initialize()
        throws Exception
    {

        configuration.setRepositoryScanning( new RepositoryScanningConfiguration()
        {
            @Override
            public List<FileType> getFileTypes()
            {
                FileType fileType = new FileType();
View Full Code Here

        action = new RepositoryScanningAction();

        config = new Configuration();

        RepositoryScanningConfiguration repositoryScanningConfig = new RepositoryScanningConfiguration();

        repositoryScanningConfig.setKnownContentConsumers( createKnownContentConsumersList() );

        config.setRepositoryScanning( repositoryScanningConfig );

        DefaultArchivaAdministration archivaAdministration = new DefaultArchivaAdministration();
        archivaAdministration.setArchivaConfiguration( archivaConfig );
View Full Code Here

        Configuration c = new Configuration();
        ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
        testRepo.setId( TEST_REPO_ID );
        testRepo.setLocation( "target/test-repository" );

        RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
        List<String> knownContentConsumers = new ArrayList<String>();
        knownContentConsumers.add( "metadata-updater12" );
        repoScanConfig.setKnownContentConsumers( knownContentConsumers );
        c.setRepositoryScanning( repoScanConfig );

        ManagedRepositoryConfiguration targetRepo = new ManagedRepositoryConfiguration();
        targetRepo.setId( "target-rep" );
        targetRepo.setLocation( "target" );
View Full Code Here

        String sourceRepo = "src/test/resources/test-repository-with-conflict-artifacts";
        ManagedRepositoryConfiguration testRepoWithConflicts = new ManagedRepositoryConfiguration();
        testRepoWithConflicts.setId( sourceRepoId );
        testRepoWithConflicts.setLocation( sourceRepo );

        RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
        List<String> knownContentConsumers = new ArrayList<String>();
        knownContentConsumers.add( "metadata-updater" );
        repoScanConfig.setKnownContentConsumers( knownContentConsumers );
        c.setRepositoryScanning( repoScanConfig );

        c.addManagedRepository( testRepo );
        c.addManagedRepository( testRepoWithConflicts );
        configuration.save( c );
View Full Code Here

    @Test
    public void testConfigureValidRepositoryConsumer()
        throws Exception
    {
        RepositoryScanningConfiguration repoScanning = new RepositoryScanningConfiguration();
        repoScanning.addKnownContentConsumer( "index-artifact" );
        repoScanning.addKnownContentConsumer( "index-pom" );
        repoScanning.addInvalidContentConsumer( "check-pom" );

        // test enable "check-metadata" consumer
        recordRepoConsumers();

        archivaConfigControl.reset();
        archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
        configControl.reset();
        configControl.expectAndReturn( config.getRepositoryScanning(), repoScanning, 1, 5 );

        archivaConfig.save( config );
        archivaConfigControl.setVoidCallable();

        repoConsumerUtilsControl.replay();
        knownContentConsumerControl.replay();
        invalidContentConsumerControl.replay();
        archivaConfigControl.replay();
        configControl.replay();

        try
        {
            boolean success = service.configureRepositoryConsumer( null, "check-metadata", true );
            assertTrue( success );
        }
        catch ( Exception e )
        {
            fail( "An exception should not have been thrown." );
        }

        repoConsumerUtilsControl.verify();
        knownContentConsumerControl.verify();
        invalidContentConsumerControl.verify();
        archivaConfigControl.verify();
        configControl.verify();

        // test disable "check-metadata" consumer
        repoConsumerUtilsControl.reset();
        knownContentConsumerControl.reset();
        invalidContentConsumerControl.reset();
        archivaConfigControl.reset();
        configControl.reset();

        repoScanning.addInvalidContentConsumer( "check-metadata" );

        recordRepoConsumers();

        archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
        configControl.expectAndReturn( config.getRepositoryScanning(), repoScanning, 1, 4 );
View Full Code Here

        Configuration c = new Configuration();
        ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
        testRepo.setId( TEST_REPO_ID );
        testRepo.setLocation( "target" + File.separatorChar + "test-repository" );

        RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
        List<String> knownContentConsumers = new ArrayList<>();
        knownContentConsumers.add( "metadata-updater12" );
        repoScanConfig.setKnownContentConsumers( knownContentConsumers );
        c.setRepositoryScanning( repoScanConfig );

        ManagedRepositoryConfiguration targetRepo = new ManagedRepositoryConfiguration();
        targetRepo.setId( "target-rep" );
        targetRepo.setLocation( targetRepoPath );
View Full Code Here

TOP

Related Classes of org.apache.archiva.configuration.RepositoryScanningConfiguration

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.