org.apache.archiva.consumers.core.repository
Class CleanupReleasedSnapshotsRepositoryPurge

java.lang.Object
  extended by org.apache.archiva.consumers.core.repository.AbstractRepositoryPurge
      extended by org.apache.archiva.consumers.core.repository.CleanupReleasedSnapshotsRepositoryPurge
All Implemented Interfaces:
RepositoryPurge

public class CleanupReleasedSnapshotsRepositoryPurge
extends AbstractRepositoryPurge

This will look in a single managed repository, and purge any snapshots that are present that have a corresponding released version on the same repository.

So, if you have the following (presented in the m2/default layout form) ...

   /com/foo/foo-tool/1.0-SNAPSHOT/foo-tool-1.0-SNAPSHOT.jar
   /com/foo/foo-tool/1.1-SNAPSHOT/foo-tool-1.1-SNAPSHOT.jar
   /com/foo/foo-tool/1.2.1-SNAPSHOT/foo-tool-1.2.1-SNAPSHOT.jar
   /com/foo/foo-tool/1.2.1/foo-tool-1.2.1.jar
   /com/foo/foo-tool/2.0-SNAPSHOT/foo-tool-2.0-SNAPSHOT.jar
   /com/foo/foo-tool/2.0/foo-tool-2.0.jar
   /com/foo/foo-tool/2.1-SNAPSHOT/foo-tool-2.1-SNAPSHOT.jar
 
then the current highest ranked released (non-snapshot) version is 2.0, which means the snapshots from 1.0-SNAPSHOT, 1.1-SNAPSHOT, 1.2.1-SNAPSHOT, and 2.0-SNAPSHOT can be purged. Leaving 2.1-SNAPSHOT in alone.


Field Summary
private  ManagedRepositoryAdmin managedRepositoryAdmin
           
private  MetadataTools metadataTools
           
private  RepositoryContentFactory repoContentFactory
           
 
Fields inherited from class org.apache.archiva.consumers.core.repository.AbstractRepositoryPurge
listeners, log, repository, repositorySession
 
Constructor Summary
CleanupReleasedSnapshotsRepositoryPurge(ManagedRepositoryContent repository, MetadataTools metadataTools, ManagedRepositoryAdmin managedRepositoryAdmin, RepositoryContentFactory repoContentFactory, RepositorySession repositorySession, List<RepositoryListener> listeners)
           
 
Method Summary
 void process(String path)
          Perform checking on artifact for repository purge
private  void updateMetadata(ArtifactReference artifact)
           
 
Methods inherited from class org.apache.archiva.consumers.core.repository.AbstractRepositoryPurge
purge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metadataTools

private MetadataTools metadataTools

managedRepositoryAdmin

private ManagedRepositoryAdmin managedRepositoryAdmin

repoContentFactory

private RepositoryContentFactory repoContentFactory
Constructor Detail

CleanupReleasedSnapshotsRepositoryPurge

public CleanupReleasedSnapshotsRepositoryPurge(ManagedRepositoryContent repository,
                                               MetadataTools metadataTools,
                                               ManagedRepositoryAdmin managedRepositoryAdmin,
                                               RepositoryContentFactory repoContentFactory,
                                               RepositorySession repositorySession,
                                               List<RepositoryListener> listeners)
Method Detail

process

public void process(String path)
             throws RepositoryPurgeException
Description copied from interface: RepositoryPurge
Perform checking on artifact for repository purge

Parameters:
path - path to the scanned artifact
Throws:
RepositoryPurgeException

updateMetadata

private void updateMetadata(ArtifactReference artifact)


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