Examples of ArtifactsByRepositoryConstraint


Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

    {
       
        Calendar greaterThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE );
        greaterThanThisDate.add( Calendar.DATE, -( getNumberOfDaysBeforeNow() ) );
       
        Constraint artifactsByRepo = new ArtifactsByRepositoryConstraint( repoId, greaterThanThisDate.getTime(), "whenGathered", false );
        List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( artifactsByRepo );

        List<RssFeedEntry> entries = processData( artifacts, true );

        return generator.generateFeed( getTitle() + "\'" + repoId + "\'", "New artifacts found in repository " +
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

               
            try
            {
                //TODO use the repo content stats whenGathered date instead of endDate for single repo reports
                List<ArchivaArtifact> types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setJarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, WAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setWarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, MAVEN_PLUGIN, endDate, "whenGathered" ) );
                repoStatistics.setPluginCount( types.size() );

                types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, EAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setEarCount( types.size() );

                types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, DLL_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setDllCount( types.size() );

                types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, EXE_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setExeCount( types.size() );

                types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, ZIP_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setZipCount( types.size() );
                // TODO: must need to be able to track archetypes. possible way of identifying an
                //      archetype is by checking if archetype.xml exists in src/main/resources/META-INF/
               
            }
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

       
        // get first page
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 5 );
       
        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
       
        daoControl.verify();
        artifactDaoControl.verify();
       
        assertEquals( 5, data.size() );
       
        RepositoryStatistics stats = (RepositoryStatistics) data.get( 0 );       
        assertEquals( REPO, stats.getRepositoryId() );
        assertEquals( 200, stats.getArtifactCount() );
        assertEquals( 5, stats.getJarCount() );
        assertEquals( 5, stats.getWarCount() );
        assertEquals( 5, stats.getPluginCount() );
        assertEquals( toDate( 2008, 11, 1, 0, 0, 0 ).getTime(), stats.getDateOfScan().getTime() );
        assertEquals( toDate( 2008, 9, 1, 0, 0, 0 ).getTime(), ( (RepositoryStatistics) data.get( 4 ) ).getDateOfScan().getTime() );
       
        // get last page
        limits.setCurrentPage( 5 );
       
        daoControl.reset();
        artifactDaoControl.reset();
       
        artifactDaoControl.setDefaultMatcher( new AlwaysMatcher() );
       
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins );
       
        daoControl.replay();
        artifactDaoControl.replay();
       
        data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

       
        // get first page
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 21 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 21 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 21 );
       
        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, false );
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

        List<RepositoryContentStatistics> repoContentStats = createStatisticsHistoryForSingleRepositoryTest( REPO );
               
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 5 );
       
        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

               
        // total artifact count
        try
        {
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts(
                      new ArtifactsByRepositoryConstraint( arepo.getId(), stats.getWhenGathered(), "groupId", true ) );           
            dbstats.setTotalArtifactCount( artifacts.size() );
        }
        catch ( ObjectNotFoundException oe )
        {
            log.error( "Object not found in the database : " + oe.getMessage() );
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

               
            try
            {
                //TODO use the repo content stats whenGathered date instead of endDate for single repo reports
                List<ArchivaArtifact> types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setJarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, WAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setWarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, MAVEN_PLUGIN, endDate, "whenGathered" ) );
                repoStatistics.setPluginCount( types.size() );
               
                // TODO: must need to be able to track archetypes. possible way of identifying an
                //      archetype is by checking if archetype.xml exists in src/main/resources/META-INF/
               
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

    }

    private void cleanupDatabase( String repoId )
        throws ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsByRepositoryConstraint( repoId );

        List<ArchivaArtifact> artifacts = archivaDAO.getArtifactDAO().queryArtifacts( constraint );

        for ( ArchivaArtifact artifact : artifacts )
        {
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

        dbstats.setWhenGathered( stats.getWhenGathered() );

        // total artifact count
        // note that when gathered is the end of the scan, so we look for all those before that time
        dbstats.setTotalArtifactCount( dao.getArtifactDAO().countArtifacts(
            new ArtifactsByRepositoryConstraint( arepo.getId(), stats.getWhenGathered(), "groupId", true ) ) );

        // total repo size -- TODO: needs to exclude ignored files (eg .svn)
        long size = FileUtils.sizeOfDirectory( new File( arepo.getLocation() ) );
        dbstats.setTotalSize( size );
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint

               
            try
            {
                //TODO use the repo content stats whenGathered date instead of endDate for single repo reports
                List types = artifactDao.queryArtifacts(
                         new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setJarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, WAR_TYPE, endDate, "whenGathered" ) );
                repoStatistics.setWarCount( types.size() );
               
                types = artifactDao.queryArtifacts(
                        new ArtifactsByRepositoryConstraint( repository, MAVEN_PLUGIN, endDate, "whenGathered" ) );
                repoStatistics.setPluginCount( types.size() );
               
                // TODO: must need to be able to track archetypes. possible way of identifying an
                //      archetype is by checking if archetype.xml exists in src/main/resources/META-INF/
               
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.