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.common.utils.BaseFile;
23 import org.apache.maven.archiva.model.ArchivaRepository;
24 import org.apache.maven.artifact.repository.ArtifactRepository;
26 import java.util.List;
31 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
34 public interface Consumer
36 public static final String ROLE = Consumer.class.getName();
39 * This is the human readable name for the discoverer.
41 * @return the human readable discoverer name.
43 public String getName();
46 * This is used to initialize any internals in the consumer before it is used.
48 * This method is called by the internals of archiva and is not meant to be used by other developers.
49 * This method is called once per repository.
51 * @param repository the repository to initialize the consumer against.
52 * @return true if the repository is valid for this consumer. false will result in consumer being disabled
53 * for the provided repository.
55 public boolean init( ArchivaRepository repository );
58 * Get the List of excluded file patterns for this consumer.
60 * @return the list of excluded file patterns for this consumer.
62 public List getExcludePatterns();
65 * Get the List of included file patterns for this consumer.
67 * @return the list of included file patterns for this consumer.
69 public List getIncludePatterns();
72 * Called by archiva framework to indicate that there is a file suitable for consuming,
73 * This method will only be called if the {@link #init(ArtifactRepository)} and {@link #getExcludePatterns()}
74 * and {@link #getIncludePatterns()} all pass for this consumer.
76 * @param file the file to process.
77 * @throws ConsumerException if there was a problem processing this file.
79 public void processFile( BaseFile file ) throws ConsumerException;
82 * Called by archiva framework to indicate that there has been a problem detected
85 * NOTE: It is very possible for 1 file to have more than 1 problem associated with it.
87 * @param file the file to process.
88 * @param message the message describing the problem.
90 public void processFileProblem( BaseFile file, String message );