hudson.tasks
Class LogRotator

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<BuildDiscarder>
      extended by jenkins.model.BuildDiscarder
          extended by hudson.tasks.LogRotator
All Implemented Interfaces:
ExtensionPoint, Describable<BuildDiscarder>

public class LogRotator
extends BuildDiscarder

Default implementation of BuildDiscarder. For historical reason, this is called LogRotator, but it does not rotate logs :-) Since 1.350 it has also the option to keep the build, but delete its recorded artifacts.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class LogRotator.LRDescriptor
           
 
Nested classes/interfaces inherited from class jenkins.model.BuildDiscarder
BuildDiscarder.ConverterImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
LogRotator(int daysToKeep, int numToKeep)
          Deprecated. since 1.350. Use LogRotator(int, int, int, int)
LogRotator(int daysToKeep, int numToKeep, int artifactDaysToKeep, int artifactNumToKeep)
           
LogRotator(String daysToKeepStr, String numToKeepStr, String artifactDaysToKeepStr, String artifactNumToKeepStr)
           
 
Method Summary
 int getArtifactDaysToKeep()
           
 String getArtifactDaysToKeepStr()
           
 int getArtifactNumToKeep()
           
 String getArtifactNumToKeepStr()
           
 int getDaysToKeep()
           
 String getDaysToKeepStr()
           
 int getNumToKeep()
           
 String getNumToKeepStr()
           
static int parse(String p)
           
 void perform(Job<?,?> job)
          Called to perform "garbage collection" on the job to discard old build records.
 
Methods inherited from class jenkins.model.BuildDiscarder
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogRotator

@DataBoundConstructor
public LogRotator(String daysToKeepStr,
                                       String numToKeepStr,
                                       String artifactDaysToKeepStr,
                                       String artifactNumToKeepStr)

LogRotator

public LogRotator(int daysToKeep,
                  int numToKeep)
Deprecated. since 1.350. Use LogRotator(int, int, int, int)


LogRotator

public LogRotator(int daysToKeep,
                  int numToKeep,
                  int artifactDaysToKeep,
                  int artifactNumToKeep)
Method Detail

parse

public static int parse(String p)

perform

public void perform(Job<?,?> job)
             throws IOException,
                    InterruptedException
Description copied from class: BuildDiscarder
Called to perform "garbage collection" on the job to discard old build records.

Normally invoked automatically jobs when new builds occur. The general expectation is that those marked as Run.isKeepLog() will be kept untouched. To delete the build record, call Run.delete().

Specified by:
perform in class BuildDiscarder
Throws:
IOException
InterruptedException
See Also:
Job.logRotate()

getDaysToKeep

public int getDaysToKeep()

getNumToKeep

public int getNumToKeep()

getArtifactDaysToKeep

public int getArtifactDaysToKeep()

getArtifactNumToKeep

public int getArtifactNumToKeep()

getDaysToKeepStr

public String getDaysToKeepStr()

getNumToKeepStr

public String getNumToKeepStr()

getArtifactDaysToKeepStr

public String getArtifactDaysToKeepStr()

getArtifactNumToKeepStr

public String getArtifactNumToKeepStr()


Copyright © 2004-2013. All Rights Reserved.