hudson.slaves
Class SimpleScheduledRetentionStrategy

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<RetentionStrategy<?>>
      extended by hudson.slaves.RetentionStrategy<SlaveComputer>
          extended by hudson.slaves.SimpleScheduledRetentionStrategy
All Implemented Interfaces:
ExtensionPoint, Describable<RetentionStrategy<?>>

public class SimpleScheduledRetentionStrategy
extends RetentionStrategy<SlaveComputer>

RetentionStrategy that controls the slave based on a schedule.

Since:
1.275
Author:
Stephen Connolly

Nested Class Summary
static class SimpleScheduledRetentionStrategy.DescriptorImpl
           
 
Nested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.Demand
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP
 
Constructor Summary
SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive)
           
 
Method Summary
 long check(SlaveComputer c)
          This method will be called periodically to allow this strategy to decide what to do with it's owning slave.
 String getStartTimeSpec()
           
 int getUpTimeMins()
           
 boolean isKeepUpWhenActive()
           
 boolean isManualLaunchAllowed(SlaveComputer c)
          This method is called to determine whether manual launching of the slave is allowed at this point in time.
protected  Object readResolve()
           
 
Methods inherited from class hudson.slaves.RetentionStrategy
all, start
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScheduledRetentionStrategy

@DataBoundConstructor
public SimpleScheduledRetentionStrategy(String startTimeSpec,
                                                             int upTimeMins,
                                                             boolean keepUpWhenActive)
                                 throws antlr.ANTLRException
Throws:
antlr.ANTLRException
Method Detail

getUpTimeMins

public int getUpTimeMins()

isKeepUpWhenActive

public boolean isKeepUpWhenActive()

getStartTimeSpec

public String getStartTimeSpec()

readResolve

protected Object readResolve()
                      throws ObjectStreamException
Throws:
ObjectStreamException

isManualLaunchAllowed

public boolean isManualLaunchAllowed(SlaveComputer c)
Description copied from class: RetentionStrategy
This method is called to determine whether manual launching of the slave is allowed at this point in time.

Overrides:
isManualLaunchAllowed in class RetentionStrategy<SlaveComputer>
Parameters:
c - Computer for which this strategy is assigned. This computer may be online or offline. This object also exposes a bunch of properties that the callee can use to decide if manual launching is allowed at this time.
Returns:
true if manual launching of the slave is allowed at this point in time.

check

public long check(SlaveComputer c)
Description copied from class: RetentionStrategy
This method will be called periodically to allow this strategy to decide what to do with it's owning slave.

Specified by:
check in class RetentionStrategy<SlaveComputer>
Parameters:
c - Computer for which this strategy is assigned. This computer may be online or offline. This object also exposes a bunch of properties that the callee can use to decide what action to take.
Returns:
The number of minutes after which the strategy would like to be checked again. The strategy may be rechecked earlier or later that this!


Copyright © 2004-2013. All Rights Reserved.