org.apache.archiva.consumers
Interface RepositoryContentConsumer

All Superinterfaces:
Consumer
All Known Subinterfaces:
InvalidRepositoryContentConsumer, KnownRepositoryContentConsumer
All Known Implementing Classes:
ArchivaMetadataCreationConsumer, ArtifactMissingChecksumsConsumer, AutoRemoveConsumer, AutoRenameConsumer, DuplicateArtifactsConsumer, LegacyConverterArtifactConsumer, MetadataUpdaterConsumer, MockInvalidRepositoryContentConsumer, NexusIndexerConsumer, RepositoryPurgeConsumer, ValidateChecksumConsumer

public interface RepositoryContentConsumer
extends Consumer

A consumer of content (files) in the repository. olamy: TODO/FIXME we must review this api, in the current situation we use prototype beans rather than singletons this is a bit memory consuming the better will be to ConsumerContext bean to transport repository context etc...


Method Summary
 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)
           
 
Methods inherited from interface org.apache.archiva.consumers.Consumer
addConsumerMonitor, getDescription, getId, isPermanent, removeConsumerMonitor
 

Method Detail

getIncludes

List<String> getIncludes()
Get the list of included file patterns for this consumer.

Returns:
the list of String patterns. (example: "**/*.pom")

getExcludes

List<String> getExcludes()
Get the list of excluded file patterns for this consumer.

Returns:
the list of String patterns. (example: "**/*.pom") - (can be null for no exclusions)

beginScan

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.

Parameters:
repository - the repository that this consumer is being used for.
whenGathered - the start of the repository scan
Throws:
ConsumerException - if there was a problem with using the provided repository with the consumer.

beginScan

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.

Parameters:
repository - the repository that this consumer is being used for.
whenGathered - the start of the repository scan
executeOnEntireRepo - flags whether the consumer will be executed on an entire repository or just on a specific resource
Throws:
ConsumerException - if there was a problem with using the provided repository with the consumer.
See Also:
beginScan(ManagedRepository, java.util.Date)

processFile

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.

Parameters:
path - the relative file path (in the repository) to process.
Throws:
ConsumerException - if there was a problem processing this file.

processFile

void processFile(String path,
                 boolean executeOnEntireRepo)
                 throws Exception
Parameters:
path -
executeOnEntireRepo -
Throws:
Exception

completeScan

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.


completeScan

void completeScan(boolean executeOnEntireRepo)
Parameters:
executeOnEntireRepo -
Throws:
Exception

isProcessUnmodified

boolean isProcessUnmodified()
Whether the consumer should process files that have not been modified since the time passed in to the scan method.

Returns:
whether to process the unmodified files


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.