]> source.dussan.org Git - archiva.git/commitdiff
[MRM-297] Result.processor can't be null.
authorJoakim Erdfelt <joakime@apache.org>
Fri, 2 Mar 2007 14:25:20 +0000 (14:25 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Fri, 2 Mar 2007 14:25:20 +0000 (14:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@513779 13f79535-47bb-0310-9956-ffa450edef68

archiva-core/src/main/java/org/apache/maven/archiva/consumers/ArtifactHealthConsumer.java
archiva-model/src/main/java/org/apache/maven/archiva/model/health/ArtifactHealth.java
archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/LocationArtifactReportProcessor.java

index 7b6d15ffbdd75f80aa08df677519b5c278511e1b..d20594f08c8c0d00542f8ec82d90a7c67a85b223 100644 (file)
@@ -73,11 +73,11 @@ public class ArtifactHealthConsumer
         }
         catch ( InvalidArtifactRTException e )
         {
-            database.addWarning( artifact, null, null, "Invalid artifact [" + artifact + "] : " + e );
+            database.addWarning( artifact, "health", "invalid", "Invalid artifact [" + artifact + "] : " + e );
         }
         catch ( ProjectBuildingException e )
         {
-            database.addWarning( artifact, null, null, "Error reading project model: " + e );
+            database.addWarning( artifact, "health", "project-build", "Error reading project model: " + e );
         }
         
         database.remove( artifact );
index ace001bdf932a2155b89474caca449bac7d393c9..e26435c41f49fe051855fe9f8eea8a337d5e6f8a 100644 (file)
@@ -1,6 +1,63 @@
 package org.apache.maven.archiva.model.health;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.archiva.model.ArchivaArtifact;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * ArtifactHealth 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
 public class ArtifactHealth
 {
+    private ArchivaArtifact artifact;
+    
+    private List problems = new ArrayList();
+
+    public void addProblem( HealthProblem problem )
+    {
+        this.problems.add( problem );
+    }
+
+    public ArchivaArtifact getArtifact()
+    {
+        return artifact;
+    }
+
+    public List getProblems()
+    {
+        return problems;
+    }
+
+    public void setArtifact( ArchivaArtifact artifact )
+    {
+        this.artifact = artifact;
+    }
 
+    public void setProblems( List problems )
+    {
+        this.problems = problems;
+    }
 }
index a8f5129b18cecc7bc5f694116e5755037100f454..cc68ea9d6379de5580aa20ff547075fc3588bdcf 100644 (file)
@@ -226,7 +226,7 @@ public class LocationArtifactReportProcessor
     private void addWarning( Artifact artifact, String reason )
     {
         // TODO: reason could be an i18n key derived from the processor and the problem ID and the
-        database.addWarning( artifact, ROLE_HINT, null, reason );
+        database.addWarning( artifact, ROLE_HINT, "bad-location", reason );
     }
 
     private Model readModel( InputStream entryStream )