1 package org.apache.archiva.repository.scanner;
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.archiva.admin.model.beans.ManagedRepository;
23 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
24 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
25 import org.springframework.scheduling.annotation.Async;
27 import java.util.List;
35 public interface RepositoryScanner
38 * The value to pass to {@link #scan(ManagedRepository, long)} to have the scan
39 * operate in a fresh fashion, with no check on changes based on timestamp.
41 public static final long FRESH_SCAN = 0;
45 * Typical Ignorable Content patterns.
49 * NOTE: Do not use for normal webapp or task driven repository scanning.
53 * These patterns are only valid for archiva-cli and archiva-converter use.
56 public static final String[] IGNORABLE_CONTENT =
57 { "bin/**", "reports/**", ".index", ".reports/**", ".maven/**", "**/.svn/**", "**/*snapshot-version",
58 "*/website/**", "*/licences/**", "**/.htaccess", "**/*.html", "**/*.txt", "**/README*", "**/CHANGELOG*",
59 "**/KEYS*", ".indexer" };
62 * Scan the repository for content changes.
64 * Internally, this will use the as-configured known and invalid consumer lists.
66 * @param repository the repository to change.
67 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
68 * (To have all content be taken into consideration regardless of timestamp,
69 * use the {@link #FRESH_SCAN} constant)
70 * @return the statistics for this scan.
71 * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started.
73 RepositoryScanStatistics scan( ManagedRepository repository, long changesSince )
74 throws RepositoryScannerException;
77 * Scan the repository for content changes.
79 * Internally, this will use the as-configured known and invalid consumer lists.
81 * @param repository the repository to change.
82 * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer}
83 * interface that should be used for this scan.
84 * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer}
85 * interface that should be used for this scan.
86 * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer.
87 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
88 * (To have all content be taken into consideration regardless of timestamp,
89 * use the {@link #FRESH_SCAN} constant)
90 * @return the statistics for this scan.
91 * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started.
93 RepositoryScanStatistics scan( ManagedRepository repository,
94 List<KnownRepositoryContentConsumer> knownContentConsumers,
95 List<InvalidRepositoryContentConsumer> invalidContentConsumers,
96 List<String> ignoredContentPatterns, long changesSince )
97 throws RepositoryScannerException;
99 Set<RepositoryScannerInstance> getInProgressScans();