This project has retired. For details please refer to its Attic page.
LocationArtifactsConsumer

org.apache.maven.archiva.reporting.artifact
Class LocationArtifactsConsumer

Package class diagram package LocationArtifactsConsumer
java.lang.Object
  extended by org.apache.maven.archiva.consumers.AbstractMonitoredConsumer
      extended by org.apache.maven.archiva.reporting.artifact.LocationArtifactsConsumer
All Implemented Interfaces:
Consumer, ArchivaArtifactConsumer, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.registry.RegistryListener

public class LocationArtifactsConsumer
extends AbstractMonitoredConsumer
implements ArchivaArtifactConsumer, org.codehaus.plexus.registry.RegistryListener, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

Validate the location of the artifact based on the values indicated in its pom (both the pom packaged with the artifact & the pom in the file system).


Constructor Summary
LocationArtifactsConsumer()
           
 
Method Summary
 void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 void beginScan()
           Event that triggers at the beginning of a scan.
 void completeScan()
           Event that triggers on the completion of a scan.
 java.lang.String getDescription()
          The human readable description for this consumer.
 java.lang.String getId()
          This is the id for the consumer.
 java.util.List<java.lang.String> getIncludedTypes()
          Get the list of included file patterns for this consumer.
 void initialize()
           
 boolean isPermanent()
          Flag indicating permanance of consumer.
 void processArchivaArtifact(ArchivaArtifact artifact)
          Check whether the artifact is in its proper location.
 
Methods inherited from class org.apache.maven.archiva.consumers.AbstractMonitoredConsumer
addConsumerMonitor, getDefaultArtifactExclusions, isProcessUnmodified, removeConsumerMonitor, triggerConsumerError, triggerConsumerInfo, triggerConsumerWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.archiva.consumers.Consumer
addConsumerMonitor, removeConsumerMonitor
 

Constructor Detail

LocationArtifactsConsumer

public LocationArtifactsConsumer()
Method Detail

getId

public java.lang.String getId()
Description copied from interface: Consumer
This is the id for the consumer.

Specified by:
getId in interface Consumer
Returns:
the consumer id.

getDescription

public java.lang.String getDescription()
Description copied from interface: Consumer
The human readable description for this consumer.

Specified by:
getDescription in interface Consumer
Returns:
the human readable description for this consumer.

isPermanent

public boolean isPermanent()
Description copied from interface: Consumer
Flag indicating permanance of consumer. (if it can be disabled or not)

Specified by:
isPermanent in interface Consumer
Returns:
true indicating that consumer is permanent and cannot be disabled.

beginScan

public void beginScan()
Description copied from interface: ArchivaArtifactConsumer

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.

Specified by:
beginScan in interface ArchivaArtifactConsumer

completeScan

public void completeScan()
Description copied from interface: ArchivaArtifactConsumer

Event that triggers on the completion of a scan.

NOTE: If the consumer opted to batch up processing requests in the ArchivaArtifactConsumer.processArchivaArtifact(ArchivaArtifact) event this would be the last opportunity to drain any processing queue's.

Specified by:
completeScan in interface ArchivaArtifactConsumer

getIncludedTypes

public java.util.List<java.lang.String> getIncludedTypes()
Description copied from interface: ArchivaArtifactConsumer
Get the list of included file patterns for this consumer.

Specified by:
getIncludedTypes in interface ArchivaArtifactConsumer
Returns:
the list of (String) artifact types to process.

processArchivaArtifact

public void processArchivaArtifact(ArchivaArtifact artifact)
                            throws ConsumerException
Check whether the artifact is in its proper location. The location of the artifact is validated first against the groupId, artifactId and versionId in the specified model object (pom in the file system). Then unpack the artifact (jar file) and get the model (pom) included in the package. If a model exists inside the package, then check if the artifact's location is valid based on the location specified in the pom. Check if the both the location specified in the file system pom and in the pom included in the package is the same.

Specified by:
processArchivaArtifact in interface ArchivaArtifactConsumer
Throws:
ConsumerException - if there was a problem processing this file.

afterConfigurationChange

public void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                     java.lang.String propertyName,
                                     java.lang.Object propertyValue)
Specified by:
afterConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

beforeConfigurationChange

public void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                      java.lang.String propertyName,
                                      java.lang.Object propertyValue)
Specified by:
beforeConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException