Package hudson.slaves
Class SimpleScheduledRetentionStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<RetentionStrategy<?>>
RetentionStrategy that controls the agent based on a schedule.- Since:
- 1.275
- Author:
- Stephen Connolly
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.DemandNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP -
Constructor Summary
ConstructorsConstructorDescriptionSimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) -
Method Summary
Modifier and TypeMethodDescriptionlongThis method will be called periodically to allow this strategy to decide what to do with its owning agent.intbooleanReturnstrueif the computer is accepting tasks.booleanbooleanThis method is called to determine whether manual launching of the agent is allowed right now.protected ObjectMethods inherited from class hudson.slaves.RetentionStrategy
all, startMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
SimpleScheduledRetentionStrategy
@DataBoundConstructor public SimpleScheduledRetentionStrategy(String startTimeSpec, int upTimeMins, boolean keepUpWhenActive) - Parameters:
startTimeSpec- the crontab entry to be parsed- Throws:
IllegalArgumentException- if the crontab entry cannot be parsed
-
-
Method Details
-
getUpTimeMins
public int getUpTimeMins() -
isKeepUpWhenActive
public boolean isKeepUpWhenActive() -
getStartTimeSpec
-
readResolve
- Throws:
ObjectStreamException
-
isManualLaunchAllowed
Description copied from class:RetentionStrategyThis method is called to determine whether manual launching of the agent is allowed right now.- Overrides:
isManualLaunchAllowedin classRetentionStrategy<SlaveComputer>- Parameters:
c-Computerfor 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.- Returns:
trueif manual launching of the agent is allowed right now.
-
isAcceptingTasks
Description copied from class:RetentionStrategyReturnstrueif the computer is accepting tasks. Needed to allow retention strategies programmatic suspension of task scheduling that in preparation for going offline. Called byComputer.isAcceptingTasks()- Overrides:
isAcceptingTasksin classRetentionStrategy<SlaveComputer>- Parameters:
c- the computer.- Returns:
trueif the computer is accepting tasks- See Also:
-
check
Description copied from class:RetentionStrategyThis method will be called periodically to allow this strategy to decide what to do with its owning agent.- Specified by:
checkin classRetentionStrategy<SlaveComputer>- Parameters:
c-Computerfor 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 than this!
-