public interface RepositoryContentConsumer extends Consumer
| Modifier and Type | Method and Description |
|---|---|
void |
beginScan(ManagedRepository repository,
Date whenGathered)
Event that triggers at the beginning of a scan.
|
void |
beginScan(ManagedRepository repository,
Date whenGathered,
boolean executeOnEntireRepo)
Event that triggers at the beginning of a scan, where you can also indicate whether the consumers will be
executed on an entire repository or on a specific resource.
|
void |
completeScan()
Event that triggers on the completion of a scan.
|
void |
completeScan(boolean executeOnEntireRepo) |
List<String> |
getExcludes()
Get the list of excluded file patterns for this consumer.
|
List<String> |
getIncludes()
Get the list of included file patterns for this consumer.
|
boolean |
isProcessUnmodified()
Whether the consumer should process files that have not been modified since the time passed in to the scan
method.
|
void |
processFile(String path)
Event indicating a file is to be processed by this consumer.
|
void |
processFile(String path,
boolean executeOnEntireRepo) |
addConsumerMonitor, getDescription, getId, removeConsumerMonitorList<String> getIncludes()
String patterns. (example: "**/*.pom")List<String> getExcludes()
String patterns. (example: "**/*.pom") - (can be null for no exclusions)void beginScan(ManagedRepository repository, Date whenGathered) throws ConsumerException
Event that triggers at the beginning of a scan.
NOTE: This would be a good place to initialize the consumer, to lock any resources, and to generally start tracking the scan as a whole.
repository - the repository that this consumer is being used for.whenGathered - the start of the repository scanConsumerException - if there was a problem with using the provided repository with the consumer.void beginScan(ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo) throws ConsumerException
Event that triggers at the beginning of a scan, where you can also indicate whether the consumers will be executed on an entire repository or on a specific resource.
repository - the repository that this consumer is being used for.whenGathered - the start of the repository scanexecuteOnEntireRepo - flags whether the consumer will be executed on an entire repository or just on a specific resourceConsumerException - if there was a problem with using the provided repository with the consumer.beginScan(ManagedRepository, java.util.Date)void processFile(String path) throws ConsumerException
Event indicating a file is to be processed by this consumer.
NOTE: The consumer does not need to process the file immediately, can can opt to queue and/or track
the files to be processed in batch. Just be sure to complete the processing by the completeScan()
event.
path - the relative file path (in the repository) to process.ConsumerException - if there was a problem processing this file.void processFile(String path, boolean executeOnEntireRepo) throws Exception
path - the relative file path (in the repository) to process.executeOnEntireRepo - flags whether the consumer will be executed on an entire repository or just on a specific resourceException - if there was a problem processing this file.void completeScan()
Event that triggers on the completion of a scan.
NOTE: If the consumer opted to batch up processing requests in the processFile(String) event
this would be the last opportunity to drain any processing queue's.
void completeScan(boolean executeOnEntireRepo)
executeOnEntireRepo - flags whether the consumer will be executed on an entire repository or just on a specific resourceboolean isProcessUnmodified()
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.