Coverage Report - org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer
 
Classes in this File Line Coverage Branch Coverage Complexity
ArchivaArtifactConsumer
N/A
N/A
0
 
 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.maven.archiva.consumers.Consumer;
 23  
 import org.apache.maven.archiva.consumers.ConsumerException;
 24  
 import org.apache.maven.archiva.model.ArchivaArtifact;
 25  
 
 26  
 import java.util.List;
 27  
 
 28  
 /**
 29  
  * ArchivaArtifactConsumer - consumer for ArchivaArtifact objects. 
 30  
  *
 31  
  * @version $Id: ArchivaArtifactConsumer.java 721514 2008-11-28 15:15:57Z brett $
 32  
  */
 33  
 public interface ArchivaArtifactConsumer extends Consumer
 34  
 {
 35  
     /**
 36  
      * Get the list of included file patterns for this consumer.
 37  
      * 
 38  
      * @return the list of ({@link String}) artifact types to process.
 39  
      */
 40  
     public List<String> getIncludedTypes();
 41  
 
 42  
     /**
 43  
      * <p>
 44  
      * Event that triggers at the beginning of a scan.
 45  
      * </p>
 46  
      * 
 47  
      * <p>
 48  
      * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to
 49  
      * generally start tracking the scan as a whole.
 50  
      * </p>
 51  
      */
 52  
     public void beginScan();
 53  
 
 54  
     /**
 55  
      * <p>
 56  
      * Event indicating an {@link ArchivaArtifact} is to be processed by this consumer.
 57  
      * </p> 
 58  
      * 
 59  
      * <p>
 60  
      * NOTE: The consumer does not need to process the artifact immediately, can can opt to queue and/or track
 61  
      * the artifact to be processed in batch.  Just be sure to complete the processing by the {@link #completeScan()} 
 62  
      * event. 
 63  
      * </p>
 64  
      * 
 65  
      * @param file the file to process.
 66  
      * @throws ConsumerException if there was a problem processing this file.
 67  
      */
 68  
     public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException;
 69  
 
 70  
     /**
 71  
      * <p>
 72  
      * Event that triggers on the completion of a scan.
 73  
      * </p>
 74  
      * 
 75  
      * <p>
 76  
      * NOTE: If the consumer opted to batch up processing requests in the 
 77  
      * {@link #processArchivaArtifact(ArchivaArtifact)} event this would be the last opportunity to drain 
 78  
      * any processing queue's.
 79  
      * </p>
 80  
      */
 81  
     public void completeScan();
 82  
 }