Package org.apache.maven.archiva.database

Examples of org.apache.maven.archiva.database.Constraint


    }
   
    public void testStatsWithDateRange()
        throws Exception
    {
        Constraint constraint =
            new RepositoryContentStatisticsByRepositoryConstraint( "internal", toDate( "2007/10/18 8:00:00" ),
                                                                   toDate( "2007/10/20 8:00:00" ) );
        List<RepositoryContentStatistics> results = dao.getRepositoryContentStatisticsDAO().queryRepositoryContentStatistics( constraint );
        assertNotNull( "Stats: results (not null)", results );
        assertEquals( "Stats: results.size", 3, results.size() );
View Full Code Here


    }

    private void assertArtifactWasSaved(String groupId, String artifactId, String version)
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
        List<ArchivaArtifact> artifacts = artifactDao.queryArtifacts( constraint );
       
        assertFalse( "Artifact '" + groupId + ":" + artifactId + ":" + version + "' should have been found.",
                     artifacts.isEmpty() );
    }
View Full Code Here

    {
       
        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

    private SyndFeed processNewVersionsOfArtifact( String repoId, String groupId, String artifactId )
        throws ArchivaDatabaseException
    {
                   
        Constraint artifactVersions = new ArtifactVersionsConstraint( repoId, groupId, artifactId, "whenGathered" );
        List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( artifactVersions );
       
        List<RssFeedEntry> entries = processData( artifacts, false );
        String key = groupId + ":" + artifactId;
       
View Full Code Here

    private ArchivaArtifact getArtifact( final String principal, final List<String> observableRepositoryIds,
                                         final String groupId, final String artifactId, final String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = null;
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );

        try
        {
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts( constraint );
View Full Code Here

                if ( VersionUtil.getBaseVersion( uniqueVersion ).equals( version ) )
                {
                    try
                    {
                        log.debug( "Retrieving artifact with version " + uniqueVersion );
                        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, uniqueVersion );
                        List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts( constraint );

                        for ( ArchivaArtifact artifact : artifacts )
                        {
                            if ( artifact.getRepositoryId().equals( repositoryId ) )
View Full Code Here

        return jasperPresent.booleanValue();
    }

    private Constraint configureConstraint()
    {
        Constraint constraint;

        range[0] = ( page - 1 ) * rowCount;
        range[1] = ( page * rowCount ) + 1; // Add 1 to check if it's the last page or not.

        if ( groupId != null && ( !groupId.equals( "" ) ) )
View Full Code Here

        {
            addActionError( "Unable to search for a blank checksum" );
            return INPUT;
        }

        Constraint constraint = new ArtifactsByChecksumConstraint( q );
       
        ArtifactDAO artifactDao = dao.getArtifactDAO();
        databaseResults = artifactDao.queryArtifacts( constraint );

        if ( databaseResults.isEmpty() )
View Full Code Here

        return jasperPresent.booleanValue();
    }

    private Constraint configureConstraint()
    {
        Constraint constraint;

        range[0] = ( page - 1 ) * rowCount;
        range[1] = ( page * rowCount ) + 1; // Add 1 to check if it's the last page or not.

        if ( groupId != null && ( !groupId.equals( "" ) ) )
View Full Code Here

    {
        StringBuffer sb = new StringBuffer();

        try
        {
            Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );
            List relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint );

            if ( relatedArtifacts != null )
            {
                String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId();
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.database.Constraint

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.