1 package org.apache.maven.archiva.reporting;
4 * Copyright 2005-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import org.apache.maven.artifact.Artifact;
20 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
22 import java.util.ArrayList;
23 import java.util.Iterator;
24 import java.util.List;
27 * @plexus.component role="org.apache.maven.archiva.reporting.ArtifactReporter"
29 public class DefaultArtifactReporter
30 implements ArtifactReporter
32 private List artifactFailures = new ArrayList();
34 private List artifactSuccesses = new ArrayList();
36 private List artifactWarnings = new ArrayList();
38 private List metadataFailures = new ArrayList();
40 private List metadataSuccesses = new ArrayList();
42 private List metadataWarnings = new ArrayList();
44 public void addFailure( Artifact artifact, String reason )
46 artifactFailures.add( new ArtifactResult( artifact, reason ) );
49 public void addSuccess( Artifact artifact )
51 artifactSuccesses.add( new ArtifactResult( artifact ) );
54 public void addWarning( Artifact artifact, String message )
56 artifactWarnings.add( new ArtifactResult( artifact, message ) );
59 public void addFailure( RepositoryMetadata metadata, String reason )
61 metadataFailures.add( new RepositoryMetadataResult( metadata, reason ) );
64 public void addSuccess( RepositoryMetadata metadata )
66 metadataSuccesses.add( new RepositoryMetadataResult( metadata ) );
69 public void addWarning( RepositoryMetadata metadata, String message )
71 metadataWarnings.add( new RepositoryMetadataResult( metadata, message ) );
74 public Iterator getArtifactFailureIterator()
76 return artifactFailures.iterator();
79 public Iterator getArtifactSuccessIterator()
81 return artifactSuccesses.iterator();
84 public Iterator getArtifactWarningIterator()
86 return artifactWarnings.iterator();
89 public Iterator getRepositoryMetadataFailureIterator()
91 return metadataFailures.iterator();
94 public Iterator getRepositoryMetadataSuccessIterator()
96 return metadataSuccesses.iterator();
99 public Iterator getRepositoryMetadataWarningIterator()
101 return metadataWarnings.iterator();
104 public int getNumFailures()
106 return artifactFailures.size() + metadataFailures.size();
109 public int getNumSuccesses()
111 return artifactSuccesses.size() + metadataSuccesses.size();
114 public int getNumWarnings()
116 return artifactWarnings.size() + metadataWarnings.size();