1 | |
package org.apache.maven.archiva.reporting.artifact; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
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 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
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 | |
|
48 | |
|
49 | |
private String name; |
50 | |
|
51 | |
|
52 | |
|
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 | |
|
73 | 0 | return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); |
74 | |
} |
75 | |
|
76 | |
public String getName() |
77 | |
{ |
78 | 0 | return name; |
79 | |
} |
80 | |
|
81 | |
} |