Package org.apache.maven.archiva.model

Examples of org.apache.maven.archiva.model.RepositoryContentStatistics


        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualArtifactPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here


        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualMetadataPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualMetadataPaths.size(), knownConsumer.getProcessCount() );
    }
View Full Code Here

        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualProjectPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualProjectPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here

        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualArtifactPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here

            List results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );

            if ( CollectionUtils.isNotEmpty( results ) )
            {
                RepositoryContentStatistics lastStats = (RepositoryContentStatistics) results.get( 0 );
                sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
            }

            RepositoryContentStatistics stats = repoScanner.scan( arepo, sinceWhen );

            getLogger().info( "Finished repository task: " + stats.toDump( arepo ) );
           
            stats = (RepositoryContentStatistics) dao.save( stats );
        }
        catch ( ArchivaDatabaseException e )
        {
View Full Code Here

        Assert.assertEquals( RepositoryContentStatistics.class, constraint.getResultClass() );

        List<RepositoryContentStatistics> stats = new ArrayList<RepositoryContentStatistics>();
        for ( String repo : configuration.getConfiguration().getManagedRepositoriesAsMap().keySet() )
        {
            RepositoryContentStatistics statistics = new RepositoryContentStatistics();
            statistics.setRepositoryId( repo );
            stats.add( statistics );
        }
        return stats;
    }
View Full Code Here

        this.logger = logger;

        this.consumerProcessFile = new ConsumerProcessFileClosure( logger );
        this.consumerWantsFile = new ConsumerWantsFilePredicate();

        stats = new RepositoryContentStatistics();
        stats.setRepositoryId( repository.getId() );

        Closure triggerBeginScan = new TriggerBeginScanClosure( repository, logger );

        CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan );
View Full Code Here

        RepositoryScanner scanner = (RepositoryScanner) plexus.lookup( RepositoryScanner.class );

        try
        {
            RepositoryContentStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList,
                                                              ignoredContent, RepositoryScanner.FRESH_SCAN );

            System.out.println( "\n" + stats.toDump( repo ) );
        }
        catch ( RepositoryException e )
        {
            e.printStackTrace( System.err );
        }
View Full Code Here

            List results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );

            if ( CollectionUtils.isNotEmpty( results ) )
            {
                RepositoryContentStatistics lastStats = (RepositoryContentStatistics) results.get( 0 );
                sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
            }

            RepositoryContentStatistics stats = repoScanner.scan( arepo, sinceWhen );

            getLogger().info( "Finished repository task: " + stats.toDump( arepo ) );
           
            stats = (RepositoryContentStatistics) dao.save( stats );
        }
        catch ( ArchivaDatabaseException e )
        {
View Full Code Here

        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", 17, stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", 17, consumer.getProcessCount() );
        assertEquals( "Processed Count (of invalid items)", 6, badconsumer.getProcessCount() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.model.RepositoryContentStatistics

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.