1 package org.apache.maven.archiva.common.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.common.utils.BaseFile;
23 import org.apache.maven.artifact.repository.ArtifactRepository;
25 import java.util.List;
30 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
33 public interface Consumer
35 public static final String ROLE = Consumer.class.getName();
38 * This is the human readable name for the discoverer.
40 * @return the human readable discoverer name.
42 public String getName();
45 * This is used to initialize any internals in the consumer before it is used.
47 * This method is called by the internals of archiva and is not meant to be used by other developers.
48 * This method is called once per repository.
50 * @param repository the repository to initialize the consumer against.
51 * @return true if the repository is valid for this consumer. false will result in consumer being disabled
52 * for the provided repository.
54 public boolean init( ArtifactRepository repository );
57 * Get the List of excluded file patterns for this consumer.
59 * @return the list of excluded file patterns for this consumer.
61 public List getExcludePatterns();
64 * Get the List of included file patterns for this consumer.
66 * @return the list of included file patterns for this consumer.
68 public List getIncludePatterns();
71 * Called by archiva framework to indicate that there is a file suitable for consuming,
72 * This method will only be called if the {@link #init(ArtifactRepository)} and {@link #getExcludePatterns()}
73 * and {@link #getIncludePatterns()} all pass for this consumer.
75 * @param file the file to process.
76 * @throws ConsumerException if there was a problem processing this file.
78 public void processFile( BaseFile file ) throws ConsumerException;
81 * Called by archiva framework to indicate that there has been a problem detected
84 * NOTE: It is very possible for 1 file to have more than 1 problem associated with it.
86 * @param file the file to process.
87 * @param message the message describing the problem.
89 public void processFileProblem( BaseFile file, String message );