continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1332931 - in /continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge: controller/ executor/
Date Wed, 02 May 2012 06:47:24 GMT
Author: ctan
Date: Wed May  2 06:47:23 2012
New Revision: 1332931

URL: http://svn.apache.org/viewvc?rev=1332931&view=rev
Log:
[CONTINUUM-2553] move logging to the controller

Modified:
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
    continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
    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/controller/DirectoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java?rev=1332931&r1=1332930&r2=1332931&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
Wed May  2 06:47:23 2012
@@ -50,6 +50,7 @@ public class DirectoryPurgeController
     
     public void doPurge( String path )
     {
+        log.info( "--- Start: Purging directory path '{}'", path );
         try
         {
             purgeExecutor.purge( path );
@@ -58,6 +59,7 @@ public class DirectoryPurgeController
         {
             log.error( e.getMessage(), e );
         }
+        log.info( "--- End: Purging directory path '{}'", path );
     }
 
     public void initializeExecutors( AbstractPurgeConfiguration purgeConfig )

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java?rev=1332931&r1=1332930&r2=1332931&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
(original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
Wed May  2 06:47:23 2012
@@ -103,6 +103,7 @@ public class RepositoryPurgeController
     
     public void doPurge( String path )
     {
+        log.info( "--- Start: Purging repository path '{}'---", path );
         try
         {
             if ( deleteReleasedSnapshots )
@@ -116,5 +117,6 @@ public class RepositoryPurgeController
         {
             log.error( e.getMessage(), e );
         }
+        log.info( "--- End: Purging repository path '{}'---", path );
     }
 }
\ No newline at end of file

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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -52,25 +52,15 @@ 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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -65,19 +65,11 @@ 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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -38,8 +38,6 @@ 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.
@@ -50,8 +48,6 @@ public class DaysOldRepositoryPurgeExecu
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private Logger log = LoggerFactory.getLogger( DaysOldRepositoryPurgeExecutor.class );
-
     private final int daysOlder;
 
     private final int retentionCount;
@@ -72,8 +68,6 @@ public class DaysOldRepositoryPurgeExecu
     public void purge( String path )
         throws ContinuumPurgeExecutorException
     {
-        log.info( "--- Start: Repository Purge ---" );
-
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -154,8 +148,6 @@ 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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -47,7 +47,7 @@ public class ReleasedSnapshotsRepository
     extends AbstractContinuumPurgeExecutor
 {
     private Logger log = LoggerFactory.getLogger( ReleasedSnapshotsRepositoryPurgeExecutor.class
);
-    
+
     private final RepositoryManagedContent repository;
 
     public ReleasedSnapshotsRepositoryPurgeExecutor( RepositoryManagedContent repository
)
@@ -57,9 +57,7 @@ public class ReleasedSnapshotsRepository
 
     public void purge( String path )
         throws ContinuumPurgeExecutorException
-    {
-        log.info( "--- Start: Repository Purge ---" );
-                                                     
+    {                         
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -130,8 +128,6 @@ 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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -30,8 +30,6 @@ 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
@@ -40,8 +38,6 @@ public class RetentionCountDirectoryPurg
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private Logger log = LoggerFactory.getLogger( RetentionCountDirectoryPurgeExecutor.class
);
-
     private final int retentionCount;
 
     private final String directoryType;
@@ -58,19 +54,11 @@ 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=1332931&r1=1332930&r2=1332931&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
Wed May  2 06:47:23 2012
@@ -32,8 +32,6 @@ 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.
@@ -44,8 +42,6 @@ public class RetentionCountRepositoryPur
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
-    private Logger log = LoggerFactory.getLogger( RetentionCountRepositoryPurgeExecutor.class
);
-
     private final int retentionCount;
 
     private final RepositoryManagedContent repository;
@@ -59,8 +55,6 @@ public class RetentionCountRepositoryPur
     public void purge( String path )
         throws ContinuumPurgeExecutorException
     {
-        log.info( "--- Start: Repository Purge ---" );
-
         try
         {
             File artifactFile = new File( repository.getRepoRoot(), path );
@@ -111,8 +105,6 @@ 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