Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
RepositoryScanner |
|
| 0.0;0 |
1 | package org.apache.maven.archiva.repository.scanner; | |
2 | ||
3 | /* | |
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 | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
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 | |
19 | * under the License. | |
20 | */ | |
21 | ||
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; | |
26 | ||
27 | import java.util.Collection; | |
28 | import java.util.List; | |
29 | import java.util.Set; | |
30 | ||
31 | /** | |
32 | * RepositoryScanner | |
33 | * | |
34 | * @version $Id: RepositoryScanner.java 1042633 2010-12-06 13:27:53Z brett $ | |
35 | */ | |
36 | public interface RepositoryScanner | |
37 | { | |
38 | /** | |
39 | * The value to pass to {@link #scan(ManagedRepositoryConfiguration, long)} to have the scan | |
40 | * operate in a fresh fashion, with no check on changes based on timestamp. | |
41 | */ | |
42 | public static final long FRESH_SCAN = 0; | |
43 | ||
44 | /** | |
45 | * <p> | |
46 | * Typical Ignorable Content patterns. | |
47 | * </p> | |
48 | * | |
49 | * <p><strong> | |
50 | * NOTE: Do not use for normal webapp or task driven repository scanning. | |
51 | * </strong></p> | |
52 | * | |
53 | * <p> | |
54 | * These patterns are only valid for archiva-cli and archiva-converter use. | |
55 | * </p> | |
56 | */ | |
57 | public static final String[] IGNORABLE_CONTENT = { | |
58 | "bin/**", | |
59 | "reports/**", | |
60 | ".index", | |
61 | ".reports/**", | |
62 | ".maven/**", | |
63 | "**/.svn/**", | |
64 | "**/*snapshot-version", | |
65 | "*/website/**", | |
66 | "*/licences/**", | |
67 | "**/.htaccess", | |
68 | "**/*.html", | |
69 | "**/*.txt", | |
70 | "**/README*", | |
71 | "**/CHANGELOG*", | |
72 | "**/KEYS*" }; | |
73 | ||
74 | /** | |
75 | * Scan the repository for content changes. | |
76 | * | |
77 | * Internally, this will use the as-configured known and invalid consumer lists. | |
78 | * | |
79 | * @param repository the repository to change. | |
80 | * @param changesSince the timestamp to use as a threshold on what is considered new or changed. | |
81 | * (To have all content be taken into consideration regardless of timestamp, | |
82 | * use the {@link #FRESH_SCAN} constant) | |
83 | * @return the statistics for this scan. | |
84 | * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. | |
85 | */ | |
86 | public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) | |
87 | throws RepositoryException; | |
88 | ||
89 | /** | |
90 | * Scan the repository for content changes. | |
91 | * | |
92 | * Internally, this will use the as-configured known and invalid consumer lists. | |
93 | * | |
94 | * @param repository the repository to change. | |
95 | * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer} | |
96 | * interface that should be used for this scan. | |
97 | * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer} | |
98 | * interface that should be used for this scan. | |
99 | * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer. | |
100 | * @param changesSince the timestamp to use as a threshold on what is considered new or changed. | |
101 | * (To have all content be taken into consideration regardless of timestamp, | |
102 | * use the {@link #FRESH_SCAN} constant) | |
103 | * @return the statistics for this scan. | |
104 | * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. | |
105 | */ | |
106 | public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, | |
107 | List<KnownRepositoryContentConsumer> knownContentConsumers, | |
108 | List<InvalidRepositoryContentConsumer> invalidContentConsumers, | |
109 | List<String> ignoredContentPatterns, long changesSince ) | |
110 | throws RepositoryException; | |
111 | ||
112 | Set<RepositoryScannerInstance> getInProgressScans(); | |
113 | } |