Coverage Report - org.apache.maven.archiva.reporting.artifact.LocationArtifactsReport
 
Classes in this File Line Coverage Branch Coverage Complexity
LocationArtifactsReport
0%
0/6
N/A
0
 
 1  
 package org.apache.maven.archiva.reporting.artifact;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.apache.maven.archiva.database.ArchivaDAO;
 23  
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 24  
 import org.apache.maven.archiva.database.Constraint;
 25  
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 26  
 import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint;
 27  
 import org.apache.maven.archiva.model.RepositoryProblem;
 28  
 import org.apache.maven.archiva.reporting.DataLimits;
 29  
 import org.apache.maven.archiva.reporting.DynamicReportSource;
 30  
 
 31  
 import java.util.List;
 32  
 
 33  
 /**
 34  
  * LocationArtifactsReport 
 35  
  *
 36  
  * @version $Id: LocationArtifactsReport.java 755290 2009-03-17 15:53:37Z brett $
 37  
  * 
 38  
  * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" 
 39  
  *                   role-hint="artifact-location"
 40  
  */
 41  
 public class LocationArtifactsReport
 42  
     implements DynamicReportSource<RepositoryProblem>
 43  
 {
 44  
     public static final String PROBLEM_TYPE_BAD_ARTIFACT_LOCATION = "bad-artifact-location";
 45  
     
 46  
     /**
 47  
      * @plexus.configuration default-value="Artifact Locations Report"
 48  
      */
 49  
     private String name;
 50  
 
 51  
     /**
 52  
      * @plexus.requirement role-hint="jdo"
 53  
      */
 54  
     private ArchivaDAO dao;
 55  
 
 56  
     private Constraint constraint;
 57  
 
 58  
     public LocationArtifactsReport()
 59  0
     {
 60  0
         constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_BAD_ARTIFACT_LOCATION );
 61  0
     }
 62  
 
 63  
     public List<RepositoryProblem> getData()
 64  
         throws ObjectNotFoundException, ArchivaDatabaseException
 65  
     {
 66  0
         return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint );
 67  
     }
 68  
 
 69  
     public List<RepositoryProblem> getData( DataLimits limits )
 70  
         throws ObjectNotFoundException, ArchivaDatabaseException
 71  
     {
 72  
         // TODO: implement limits.
 73  0
         return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint );
 74  
     }
 75  
 
 76  
     public String getName()
 77  
     {
 78  0
         return name;
 79  
     }
 80  
 
 81  
 }