1 package org.apache.maven.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.maven.archiva.configuration.ManagedRepositoryConfiguration;
23 import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
24 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
25 import org.apache.maven.archiva.repository.RepositoryException;
27 import java.util.List;
34 public interface RepositoryScanner
37 * The value to pass to {@link #scan(ManagedRepositoryConfiguration, long)} to have the scan
38 * operate in a fresh fashion, with no check on changes based on timestamp.
40 public static final long FRESH_SCAN = 0;
44 * Typical Ignorable Content patterns.
48 * NOTE: Do not use for normal webapp or task driven repository scanning.
52 * These patterns are only valid for archiva-cli and archiva-converter use.
55 public static final String[] IGNORABLE_CONTENT = {
62 "**/*snapshot-version",
73 * Scan the repository for content changes.
75 * Internally, this will use the as-configured known and invalid consumer lists.
77 * @param repository the repository to change.
78 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
79 * (To have all content be taken into consideration regardless of timestamp,
80 * use the {@link #FRESH_SCAN} constant)
81 * @return the statistics for this scan.
82 * @throws RepositoryException if there was a fundamental problem with getting the discoverer started.
84 public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince )
85 throws RepositoryException;
88 * Scan the repository for content changes.
90 * Internally, this will use the as-configured known and invalid consumer lists.
92 * @param repository the repository to change.
93 * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer}
94 * interface that should be used for this scan.
95 * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer}
96 * interface that should be used for this scan.
97 * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer.
98 * @param changesSince the timestamp to use as a threshold on what is considered new or changed.
99 * (To have all content be taken into consideration regardless of timestamp,
100 * use the {@link #FRESH_SCAN} constant)
101 * @return the statistics for this scan.
102 * @throws RepositoryException if there was a fundamental problem with getting the discoverer started.
104 public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository,
105 List<KnownRepositoryContentConsumer> knownContentConsumers,
106 List<InvalidRepositoryContentConsumer> invalidContentConsumers,
107 List<String> ignoredContentPatterns, long changesSince )
108 throws RepositoryException;