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 java.util.Collection;
23 import java.util.List;
26 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
27 import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
28 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
35 public interface RepositoryScanner
38 * The value to pass to {@link #scan(ManagedRepositoryConfiguration, 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 = {
63 "**/*snapshot-version",
74 * Scan the repository for content changes.
76 * Internally, this will use the as-configured known and invalid consumer lists.
78 * @param repository the repository to change.
79 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
80 * (To have all content be taken into consideration regardless of timestamp,
81 * use the {@link #FRESH_SCAN} constant)
82 * @return the statistics for this scan.
83 * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started.
85 public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince )
86 throws RepositoryScannerException;
89 * Scan the repository for content changes.
91 * Internally, this will use the as-configured known and invalid consumer lists.
93 * @param repository the repository to change.
94 * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer}
95 * interface that should be used for this scan.
96 * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer}
97 * interface that should be used for this scan.
98 * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer.
99 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
100 * (To have all content be taken into consideration regardless of timestamp,
101 * use the {@link #FRESH_SCAN} constant)
102 * @return the statistics for this scan.
103 * @throws RepositoryScannerException if there was a fundamental problem with getting the discoverer started.
105 public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository,
106 List<KnownRepositoryContentConsumer> knownContentConsumers,
107 List<InvalidRepositoryContentConsumer> invalidContentConsumers,
108 List<String> ignoredContentPatterns, long changesSince )
109 throws RepositoryScannerException;
111 Set<RepositoryScannerInstance> getInProgressScans();