continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1332045 - /continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/
Date Mon, 30 Apr 2012 02:20:37 GMT
Author: ctan
Date: Mon Apr 30 02:20:37 2012
New Revision: 1332045

URL: http://svn.apache.org/viewvc?rev=1332045&view=rev
Log:
[CONTINUUM-2553] log when purge process starts and ends

Modified:
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -52,15 +52,25 @@ public class CleanAllPurgeExecutor
     {
         if ( purgeType.equals( ContinuumPurgeConstants.PURGE_REPOSITORY ) )
         {
+            log.info( "--- Start: Repository Purge ---" );
             purgeRepository( path );
+            log.info( "--- End: Repository Purge ---" );
         }
         else if ( purgeType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_RELEASES ) )
         {
+            log.info( "--- Start: Releases Directory Purge ---" );
             purgeReleases( path );
+            log.info( "--- End: Releases Directory Purge ---" );
         }
         else if ( purgeType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_BUILDOUTPUT )
)
         {
+            log.info( "--- Start: Build Output Directory Purge ---" );
             purgeBuildOutput( path );
+            log.info( "--- End: Build Output Directory Purge ---" );
+        }
+        else 
+        {
+            log.warn( "Not purging: Unknown purge type '{}'", purgeType );
         }
     }
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -65,11 +65,19 @@ public class DaysOldDirectoryPurgeExecut
     {
         if ( directoryType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_RELEASES ) )
         {
+            log.info( "--- Start: Releases Directory Purge ---" );
             purgeReleaseDirectory( path );
+            log.info( "--- End: Releases Directory Purge ---" );
         }
         else if ( directoryType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_BUILDOUTPUT
) )
         {
+            log.info( "--- Start: Build Output Directory Purge ---" );
             purgeBuildOutputDirectory( path );
+            log.info( "--- End: Build Output Directory Purge ---" );
+        }
+        else
+        {
+            log.warn( "Not purging: Unknown directory type '{}'", directoryType );
         }
     }
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldRepositoryPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -38,6 +38,8 @@ import org.apache.maven.archiva.model.Ar
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.layout.LayoutException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Codes were taken from  Archiva's DaysOldRepositoryPurge and made some few changes.
@@ -48,6 +50,8 @@ public class DaysOldRepositoryPurgeExecu
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
+    private Logger log = LoggerFactory.getLogger( DaysOldRepositoryPurgeExecutor.class );
+
     private final int daysOlder;
 
     private final int retentionCount;
@@ -68,6 +72,8 @@ public class DaysOldRepositoryPurgeExecu
     public void purge( String path )
         throws ContinuumPurgeExecutorException
     {
+        log.info( "--- Start: Repository Purge ---" );
+
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -148,6 +154,8 @@ public class DaysOldRepositoryPurgeExecu
         {
             throw new ContinuumPurgeExecutorException( e.getMessage(), e );
         }
+
+        log.info( "--- End: Repository Purge ---" );
     }
 
     private Calendar uniqueSnapshotToCalendar( String version )

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -25,10 +25,6 @@ import java.util.Collections;
 import java.util.List;
 
 import org.apache.continuum.purge.ContinuumPurgeConstants;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
 
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.archiva.common.utils.VersionComparator;
@@ -62,6 +58,8 @@ public class ReleasedSnapshotsRepository
     public void purge( String path )
         throws ContinuumPurgeExecutorException
     {
+        log.info( "--- Start: Repository Purge ---" );
+                                                     
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -132,6 +130,8 @@ public class ReleasedSnapshotsRepository
         {
             throw new ContinuumPurgeExecutorException( e.getMessage(), e );
         }
+
+        log.info( "--- End: Repository Purge ---" );
     }
 
     private void removeMetadata( VersionedReference versionRef )

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountDirectoryPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -30,6 +30,8 @@ import org.apache.commons.io.comparator.
 import org.apache.commons.io.filefilter.DirectoryFileFilter;
 import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Maria Catherine Tan
@@ -38,6 +40,8 @@ public class RetentionCountDirectoryPurg
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
+    private Logger log = LoggerFactory.getLogger( RetentionCountDirectoryPurgeExecutor.class
);
+
     private final int retentionCount;
 
     private final String directoryType;
@@ -54,11 +58,19 @@ public class RetentionCountDirectoryPurg
     {
         if ( directoryType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_RELEASES ) )
         {
+            log.info( "--- Start: Releases Directory Purge ---" );
             purgeReleaseDirectory( path );
+            log.info( "--- End: Releases Directory Purge ---" );
         }
         else if ( directoryType.equals( ContinuumPurgeConstants.PURGE_DIRECTORY_BUILDOUTPUT
) )
         {
+            log.info( "--- Start: Build Output Directory Purge ---" );
             purgeBuildOutputDirectory( path );
+            log.info( "--- End: Build Output Directory Purge ---" );
+        }
+        else
+        {
+            log.warn( "Not purging: Unknown directory type '{}'", directoryType );
         }
     }
 

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java?rev=1332045&r1=1332044&r2=1332045&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/RetentionCountRepositoryPurgeExecutor.java
Mon Apr 30 02:20:37 2012
@@ -32,6 +32,8 @@ import org.apache.maven.archiva.model.Ar
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.layout.LayoutException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Codes were taken from Archiva's RetentionCountRepository Purge and made some few changes.
@@ -42,6 +44,8 @@ public class RetentionCountRepositoryPur
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
+    private Logger log = LoggerFactory.getLogger( RetentionCountRepositoryPurgeExecutor.class
);
+
     private final int retentionCount;
 
     private final RepositoryManagedContent repository;
@@ -55,6 +59,8 @@ public class RetentionCountRepositoryPur
     public void purge( String path )
         throws ContinuumPurgeExecutorException
     {
+        log.info( "--- Start: Repository Purge ---" );
+
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -105,6 +111,8 @@ public class RetentionCountRepositoryPur
             // Nothing to do here.
             // TODO: Log this condition?
         }
+
+        log.info( "--- End: Repository Purge ---" );
     }
 
     private void doPurgeAllRelated( ArtifactReference reference, String version )



Mime
View raw message