Package org.apache.maven.archiva.database.constraints

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


                      addFieldError( "startDate", "Start Date must be earlier than the End Date" );
                      return INPUT;
                    }
                 
                    List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                           new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );
                                       
                    if( contentStats == null || contentStats.isEmpty() )
                    {  
                        addActionError( "No statistics available for repository. Repository might not have been scanned." );
                        return ERROR;
View Full Code Here


        for ( String repo : selectedRepositories )
        {  
            try
            {               
                List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                         new RepositoryContentStatisticsByRepositoryConstraint( repo, startDateInDF, endDateInDF ) );

                if ( contentStats == null || contentStats.isEmpty() )
                {
                    log.info( "No statistics available for repository '" + repo + "'." );
                    // TODO set repo's stats to 0
View Full Code Here

        String savedKeyId = JDOHelper.getObjectId( savedStats ).toString();
        assertEquals( "1[OID]org.apache.maven.archiva.model.RepositoryContentStatistics", savedKeyId );

        // query
        List results =
           repoContentStatisticsDAO.queryRepositoryContentStatistics( new RepositoryContentStatisticsByRepositoryConstraint(
                                                                                                                              "internal" ) );
        assertNotNull( results );
        assertEquals( 1, results.size() );

        RepositoryContentStatistics stats = (RepositoryContentStatistics) results.get( 0 );
        assertEquals( "internal", stats.getRepositoryId() );

        // delete
        repoContentStatisticsDAO.deleteRepositoryContentStatistics( stats );

        assertEquals( 0, repoContentStatisticsDAO.queryRepositoryContentStatistics(
            new RepositoryContentStatisticsByRepositoryConstraint( "internal" ) ).size() );
    }
View Full Code Here

        archivaDaoControl.expectAndReturn( archivaDao.getRepositoryContentStatisticsDAO(), repoContentStatsDao );

        archivaDaoControl.replay();

        repoContentStatsDao.queryRepositoryContentStatistics(
            new RepositoryContentStatisticsByRepositoryConstraint( REPO_ID ) );
        repoContentStatsDaoControl.setMatcher( MockControl.ALWAYS_MATCHER );

        List<RepositoryContentStatistics> repoStats = createRepositoryContentStatisticsList();
        repoContentStatsDaoControl.setReturnValue( repoStats );
View Full Code Here

    private void cleanupScanStats( String repoId )
        throws ArchivaDatabaseException
    {
        List<RepositoryContentStatistics> results =
            archivaDAO.getRepositoryContentStatisticsDAO().queryRepositoryContentStatistics(
            new RepositoryContentStatisticsByRepositoryConstraint( repoId ) );

        for ( RepositoryContentStatistics stats : results )
        {
            archivaDAO.getRepositoryContentStatisticsDAO().deleteRepositoryContentStatistics( stats );
        }
View Full Code Here

        }

        RepositoryContentStatisticsDAO repoContentStatsDao = archivaDAO.getRepositoryContentStatisticsDAO();

        List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                new RepositoryContentStatisticsByRepositoryConstraint( repository.getId() ) );

        if ( contentStats != null )
        {
            for ( RepositoryContentStatistics stats : contentStats )
            {
View Full Code Here

    private void cleanupScanStats( String repoId )
        throws ArchivaDatabaseException
    {
        List<RepositoryContentStatistics> results =
            archivaDAO.getRepositoryContentStatisticsDAO().queryRepositoryContentStatistics(
            new RepositoryContentStatisticsByRepositoryConstraint( repoId ) );

        for ( RepositoryContentStatistics stats : results )
        {
            archivaDAO.getRepositoryContentStatisticsDAO().deleteRepositoryContentStatistics( stats );
        }
View Full Code Here

                {  
                  startDateInDF = getStartDateInDateFormat();                 
                  endDateInDF = getEndDateInDateFormat();
                  
                    List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                           new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );
                   
                    if( contentStats == null || contentStats.isEmpty() )
                    {  
                        addActionError( "No statistics available for repository. Repository might not have been scanned." );
                        return ERROR;
View Full Code Here

                {                
                  startDateInDF = getStartDateInDateFormat();
                  endDateInDF = getEndDateInDateFormat();
                 
                    List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                           new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );
                                       
                    if( contentStats == null || contentStats.isEmpty() )
                    {  
                        addActionError( "No statistics available for repository. Repository might not have been scanned." );
                        return ERROR;
View Full Code Here

        for ( String repo : selectedRepositories )
        {  
            try
            {               
                List contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
                         new RepositoryContentStatisticsByRepositoryConstraint( repo, startDateInDF, endDateInDF ) );

                if ( contentStats == null || contentStats.isEmpty() )
                {
                    log.info( "No statistics available for repository '" + repo + "'." );
                    // TODO set repo's stats to 0
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.database.constraints.RepositoryContentStatisticsByRepositoryConstraint

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.