Class TimeCondition
- java.lang.Object
-
- org.jenkins_ci.plugins.run_condition.RunCondition
-
- org.jenkins_ci.plugins.run_condition.core.TimeCondition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<RunCondition>
public class TimeCondition extends RunCondition
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeCondition.TimeConditionDescriptor
-
Nested classes/interfaces inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
RunCondition.RunConditionDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description TimeCondition(String earliest, String latest, boolean useBuildTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEarliest()
int
getEarliestHours()
int
getEarliestMinutes()
String
getLatest()
int
getLatestHours()
int
getLatestMinutes()
protected Calendar
getNow()
protected Calendar
getTimestamp(AbstractBuild<?,?> build)
static boolean
isTimeValid(String time)
boolean
isUseBuildTime()
boolean
runPerform(AbstractBuild<?,?> build, BuildListener listener)
Decide whether to run the perform method in the BuildStep.boolean
runPrebuild(AbstractBuild<?,?> build, BuildListener listener)
Decide whether to run the prebuild method in the BuildStep.-
Methods inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
all, getDescriptor
-
-
-
-
Method Detail
-
getEarliestHours
public int getEarliestHours()
-
getEarliestMinutes
public int getEarliestMinutes()
-
getLatestHours
public int getLatestHours()
-
getLatestMinutes
public int getLatestMinutes()
-
isUseBuildTime
public boolean isUseBuildTime()
-
getEarliest
public String getEarliest()
-
getLatest
public String getLatest()
-
runPrebuild
public final boolean runPrebuild(AbstractBuild<?,?> build, BuildListener listener) throws Exception
Description copied from class:RunCondition
Decide whether to run the prebuild method in the BuildStep. If the condition depends, or may depend, on something that may be affected by the build itself, then it is probably safest to always return true here. (@TODO review this once the plugin has been in use for a while with a variety of conditions and BuildSteps) If the condition is not dependent on the state of the build i.e. just looks at the build timestamp, then this method should return the same as the runPerform method.- Specified by:
runPrebuild
in classRunCondition
- Returns:
- true if the prebuild method of the BuildStep should run
- Throws:
Exception
- See Also:
AlwaysPrebuildRunCondition
,PrebuildSameAsPerformRunCondition
-
runPerform
public final boolean runPerform(AbstractBuild<?,?> build, BuildListener listener) throws Exception
Description copied from class:RunCondition
Decide whether to run the perform method in the BuildStep.- Specified by:
runPerform
in classRunCondition
- Returns:
- true if the perform method of the BuildStep should run
- Throws:
Exception
-
getNow
protected Calendar getNow()
-
getTimestamp
protected Calendar getTimestamp(AbstractBuild<?,?> build)
-
isTimeValid
public static boolean isTimeValid(String time)
-
-