1 package org.apache.maven.archiva.consumers;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import org.apache.maven.archiva.model.ArchivaArtifact;
24 import java.util.List;
27 * ArchivaArtifactConsumer - consumer for ArchivaArtifact objects.
31 public interface ArchivaArtifactConsumer extends Consumer
34 * Get the list of included file patterns for this consumer.
36 * @return the list of ({@link String}) artifact types to process.
38 public List<String> getIncludedTypes();
42 * Event that triggers at the beginning of a scan.
46 * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to
47 * generally start tracking the scan as a whole.
50 public void beginScan();
54 * Event indicating an {@link ArchivaArtifact} is to be processed by this consumer.
58 * NOTE: The consumer does not need to process the artifact immediately, can can opt to queue and/or track
59 * the artifact to be processed in batch. Just be sure to complete the processing by the {@link #completeScan()}
63 * @param file the file to process.
64 * @throws ConsumerException if there was a problem processing this file.
66 public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException;
70 * Event that triggers on the completion of a scan.
74 * NOTE: If the consumer opted to batch up processing requests in the
75 * {@link #processArchivaArtifact(ArchivaArtifact)} event this would be the last opportunity to drain
76 * any processing queue's.
79 public void completeScan();