mirror of https://github.com/apache/archiva.git
clean up warnings in reports modules
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad7be3a3fc
commit
5881fb5829
|
@ -36,7 +36,7 @@ import java.util.List;
|
||||||
* <a href="mailto:oching@apache.org">Maria Odea Ching</a>
|
* <a href="mailto:oching@apache.org">Maria Odea Ching</a>
|
||||||
*/
|
*/
|
||||||
public class CorruptArtifactReport
|
public class CorruptArtifactReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<RepositoryProblem>
|
||||||
{
|
{
|
||||||
public static final String PROBLEM_TYPE_CORRUPT_ARTIFACT = "corrupt-artifact";
|
public static final String PROBLEM_TYPE_CORRUPT_ARTIFACT = "corrupt-artifact";
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||||
* role-hint="duplicate-artifacts"
|
* role-hint="duplicate-artifacts"
|
||||||
*/
|
*/
|
||||||
public class DuplicateArtifactReport
|
public class DuplicateArtifactReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<RepositoryProblem>
|
||||||
{
|
{
|
||||||
public static final String PROBLEM_TYPE_DUPLICATE_ARTIFACTS = "duplicate-artifacts";
|
public static final String PROBLEM_TYPE_DUPLICATE_ARTIFACTS = "duplicate-artifacts";
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||||
* role-hint="artifact-location"
|
* role-hint="artifact-location"
|
||||||
*/
|
*/
|
||||||
public class LocationArtifactsReport
|
public class LocationArtifactsReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<RepositoryProblem>
|
||||||
{
|
{
|
||||||
public static final String PROBLEM_TYPE_BAD_ARTIFACT_LOCATION = "bad-artifact-location";
|
public static final String PROBLEM_TYPE_BAD_ARTIFACT_LOCATION = "bad-artifact-location";
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.apache.maven.archiva.reporting.DynamicReportSource;
|
||||||
* role-hint="old-artifacts"
|
* role-hint="old-artifacts"
|
||||||
*/
|
*/
|
||||||
public class OldArtifactReport
|
public class OldArtifactReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<ArchivaArtifact>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @plexus.configuration default-value="Old Artifacts Report"
|
* @plexus.configuration default-value="Old Artifacts Report"
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.apache.maven.archiva.reporting.DynamicReportSource;
|
||||||
* role-hint="old-snapshots"
|
* role-hint="old-snapshots"
|
||||||
*/
|
*/
|
||||||
public class OldSnapshotArtifactReport
|
public class OldSnapshotArtifactReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<ArchivaArtifact>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @plexus.configuration default-value="Old Snapshots Report"
|
* @plexus.configuration default-value="Old Snapshots Report"
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||||
* role-hint="metadata"
|
* role-hint="metadata"
|
||||||
*/
|
*/
|
||||||
public class MetadataReport
|
public class MetadataReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<RepositoryProblem>
|
||||||
{
|
{
|
||||||
public static final String PROBLEM_TYPE_METADATA = "metadata";
|
public static final String PROBLEM_TYPE_METADATA = "metadata";
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.util.List;
|
||||||
* role-hint="missing-dependencies"
|
* role-hint="missing-dependencies"
|
||||||
*/
|
*/
|
||||||
public class MissingDependenciesReport
|
public class MissingDependenciesReport
|
||||||
implements DynamicReportSource
|
implements DynamicReportSource<RepositoryProblem>
|
||||||
{
|
{
|
||||||
public static final String PROBLEM_TYPE_MISSING_DEPENDENCY = "missing-dependency";
|
public static final String PROBLEM_TYPE_MISSING_DEPENDENCY = "missing-dependency";
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,14 @@ public class DefaultReportingManager
|
||||||
/**
|
/**
|
||||||
* @plexus.requirement role="org.apache.maven.archiva.reporting.DynamicReportSource"
|
* @plexus.requirement role="org.apache.maven.archiva.reporting.DynamicReportSource"
|
||||||
*/
|
*/
|
||||||
private Map reportSourceMap;
|
private Map<String, DynamicReportSource<?>> reportSourceMap;
|
||||||
|
|
||||||
public DynamicReportSource getReport( String id )
|
public DynamicReportSource<?> getReport( String id )
|
||||||
{
|
{
|
||||||
return (DynamicReportSource) reportSourceMap.get( id );
|
return reportSourceMap.get( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getAvailableReports()
|
public Map<String, DynamicReportSource<?>> getAvailableReports()
|
||||||
{
|
{
|
||||||
return reportSourceMap;
|
return reportSourceMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,17 @@ package org.apache.maven.archiva.reporting;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.archiva.database.ArchivaDatabaseException;
|
import org.apache.maven.archiva.database.ArchivaDatabaseException;
|
||||||
import org.apache.maven.archiva.database.ObjectNotFoundException;
|
import org.apache.maven.archiva.database.ObjectNotFoundException;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DynamicReportSource
|
* DynamicReportSource
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public interface DynamicReportSource
|
public interface DynamicReportSource<T>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The human readable name of this report.
|
* The human readable name of this report.
|
||||||
|
@ -45,7 +45,7 @@ public interface DynamicReportSource
|
||||||
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
|
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
|
||||||
* @throws ObjectNotFoundException if no records were found.
|
* @throws ObjectNotFoundException if no records were found.
|
||||||
*/
|
*/
|
||||||
public List getData() throws ObjectNotFoundException, ArchivaDatabaseException;
|
public List<T> getData() throws ObjectNotFoundException, ArchivaDatabaseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the entire list of values for this report.
|
* Get the entire list of values for this report.
|
||||||
|
@ -57,5 +57,5 @@ public interface DynamicReportSource
|
||||||
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
|
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
|
||||||
* @throws ObjectNotFoundException if no records were found.
|
* @throws ObjectNotFoundException if no records were found.
|
||||||
*/
|
*/
|
||||||
public List getData( DataLimits limits ) throws ObjectNotFoundException, ArchivaDatabaseException;
|
public List<T> getData( DataLimits limits ) throws ObjectNotFoundException, ArchivaDatabaseException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public interface ReportingManager
|
public interface ReportingManager
|
||||||
{
|
{
|
||||||
public DynamicReportSource getReport( String id );
|
public DynamicReportSource<?> getReport( String id );
|
||||||
|
|
||||||
public Map /*<String,DynamicReportSource>*/getAvailableReports();
|
public Map<String,DynamicReportSource<?>> getAvailableReports();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.apache.maven.archiva.database.ArchivaDAO;
|
||||||
import org.apache.maven.archiva.database.ArchivaDatabaseException;
|
import org.apache.maven.archiva.database.ArchivaDatabaseException;
|
||||||
import org.apache.maven.archiva.database.ArtifactDAO;
|
import org.apache.maven.archiva.database.ArtifactDAO;
|
||||||
import org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint;
|
import org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint;
|
||||||
|
import org.apache.maven.archiva.model.ArchivaArtifact;
|
||||||
import org.apache.maven.archiva.model.RepositoryContentStatistics;
|
import org.apache.maven.archiva.model.RepositoryContentStatistics;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -121,7 +122,7 @@ public class SimpleRepositoryStatisticsReportGenerator
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//TODO use the repo content stats whenGathered date instead of endDate for single repo reports
|
//TODO use the repo content stats whenGathered date instead of endDate for single repo reports
|
||||||
List types = artifactDao.queryArtifacts(
|
List<ArchivaArtifact> types = artifactDao.queryArtifacts(
|
||||||
new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
|
new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
|
||||||
repoStatistics.setJarCount( types.size() );
|
repoStatistics.setJarCount( types.size() );
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class SimpleRepositoryStatisticsReportGeneratorTest
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
|
generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
|
||||||
fail( "An ArchivaReportException should have been thrown." );
|
fail( "An ArchivaReportException should have been thrown." );
|
||||||
}
|
}
|
||||||
catch ( ArchivaReportException a )
|
catch ( ArchivaReportException a )
|
||||||
|
|
Loading…
Reference in New Issue