1 | |
package org.apache.archiva.repository.scanner.functors; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.commons.collections.Closure; |
23 | |
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; |
24 | |
import org.apache.maven.archiva.consumers.RepositoryContentConsumer; |
25 | |
import org.slf4j.Logger; |
26 | |
import org.slf4j.LoggerFactory; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class TriggerScanCompletedClosure |
32 | |
implements Closure |
33 | |
{ |
34 | 0 | private Logger log = LoggerFactory.getLogger( TriggerScanCompletedClosure.class ); |
35 | |
|
36 | |
private final ManagedRepositoryConfiguration repository; |
37 | |
|
38 | 0 | private boolean executeOnEntireRepo = true; |
39 | |
|
40 | |
public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository ) |
41 | 0 | { |
42 | 0 | this.repository = repository; |
43 | 0 | } |
44 | |
|
45 | |
public TriggerScanCompletedClosure( ManagedRepositoryConfiguration repository, boolean executeOnEntireRepo ) |
46 | |
{ |
47 | 0 | this( repository ); |
48 | 0 | this.executeOnEntireRepo = executeOnEntireRepo; |
49 | 0 | } |
50 | |
|
51 | |
public void execute( Object input ) |
52 | |
{ |
53 | 0 | if ( input instanceof RepositoryContentConsumer ) |
54 | |
{ |
55 | 0 | RepositoryContentConsumer consumer = (RepositoryContentConsumer) input; |
56 | 0 | consumer.completeScan( executeOnEntireRepo ); |
57 | 0 | log.debug( "Consumer [" + consumer.getId() + "] completed for repository [" + repository.getId() + "]" ); |
58 | |
} |
59 | 0 | } |
60 | |
} |