Coverage Report - org.apache.maven.archiva.database.updater.ProcessArchivaArtifactClosure
 
Classes in this File Line Coverage Branch Coverage Complexity
ProcessArchivaArtifactClosure
0%
0/12
0%
0/2
1.667
 
 1  
 package org.apache.maven.archiva.database.updater;
 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.commons.collections.Closure;
 23  
 import org.apache.maven.archiva.consumers.ConsumerException;
 24  
 import org.apache.maven.archiva.model.ArchivaArtifact;
 25  
 import org.slf4j.Logger;
 26  
 import org.slf4j.LoggerFactory;
 27  
 
 28  
 /**
 29  
  * ProcessArchivaArtifactClosure 
 30  
  *
 31  
  * @version $Id: ProcessArchivaArtifactClosure.java 721514 2008-11-28 15:15:57Z brett $
 32  
  */
 33  0
 class ProcessArchivaArtifactClosure
 34  
     implements Closure
 35  
 {
 36  0
     private Logger log = LoggerFactory.getLogger( ProcessArchivaArtifactClosure.class );
 37  
     
 38  
     private ArchivaArtifact artifact;
 39  
 
 40  
     public void execute( Object input )
 41  
     {
 42  0
         if ( input instanceof ArchivaArtifactConsumer )
 43  
         {
 44  0
             ArchivaArtifactConsumer consumer = (ArchivaArtifactConsumer) input;
 45  
 
 46  
             try
 47  
             {
 48  0
                 consumer.processArchivaArtifact( artifact );
 49  
             }
 50  0
             catch ( ConsumerException e )
 51  
             {
 52  0
                 log.warn( "Unable to process artifact [" + artifact + "] with consumer [" + consumer.getId() + "]", e );
 53  0
             }
 54  
         }
 55  
 
 56  0
     }
 57  
 
 58  
     public ArchivaArtifact getArtifact()
 59  
     {
 60  0
         return artifact;
 61  
     }
 62  
 
 63  
     public void setArtifact( ArchivaArtifact artifact )
 64  
     {
 65  0
         this.artifact = artifact;
 66  0
     }
 67  
 }