Coverage Report - org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure
 
Classes in this File Line Coverage Branch Coverage Complexity
TriggerScanCompletedClosure
0%
0/13
0%
0/2
1.333
 
 1  
 package org.apache.archiva.repository.scanner.functors;
 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.configuration.ManagedRepositoryConfiguration;
 24  
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
 25  
 import org.slf4j.Logger;
 26  
 import org.slf4j.LoggerFactory;
 27  
 
 28  
 /**
 29  
  * TriggerScanCompletedClosure
 30  
  */
 31  
 public class TriggerScanCompletedClosure
 32  
     implements Closure
 33  
 {
 34  0
     private Logger log = LoggerFactory.getLogger( TriggerScanCompletedClosure.class );
 35  
 
 36  
     private final ManagedRepositoryConfiguration repository;
 37  
 
 38  0
     private boolean executeOnEntireRepo = true;
 39  
 
 40  
     public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository )
 41  0
     {
 42  0
         this.repository = repository;
 43  0
     }
 44  
 
 45  
     public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository, boolean executeOnEntireRepo )
 46  
     {
 47  0
         this( repository );
 48  0
         this.executeOnEntireRepo = executeOnEntireRepo;
 49  0
     }
 50  
 
 51  
     public void execute( Object input )
 52  
     {
 53  0
         if ( input instanceof RepositoryContentConsumer )
 54  
         {
 55  0
             RepositoryContentConsumer consumer = (RepositoryContentConsumer) input;
 56  0
             consumer.completeScan( executeOnEntireRepo );
 57  0
             log.debug( "Consumer [" + consumer.getId() + "] completed for repository [" + repository.getId() + "]" );
 58  
         }
 59  0
     }
 60  
 }