Package net.solarnetwork.node.job
Class JobUtils
java.lang.Object
net.solarnetwork.node.job.JobUtils
Utility methods for working with scheduled jobs.
- Since:
- 1.71
- Version:
- 2.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternA pattern to match a digit-only second field number value. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.scheduling.TriggertriggerForExpression(String expression, TimeUnit timeUnit, boolean randomized) Create a trigger from a schedule expression.
-
Field Details
-
CRON_PLAIN_SECOND_FIELD_PATTERN
A pattern to match a digit-only second field number value.
-
-
Method Details
-
triggerForExpression
public static org.springframework.scheduling.Trigger triggerForExpression(String expression, TimeUnit timeUnit, boolean randomized) Create a trigger from a schedule expression.The
expressioncan be either an integer number representing atimeUnitfrequency or else a cron expression. Ifrandomizeis true then if the cron expression seconds value is a constant value it- Parameters:
expression- the schedule expressiontimeUnit- the time unit to use for periodic triggersrandomized- true to randomize the second field of cron triggers- Returns:
- the trigger, or null if the expression cannot be parsed into one
- Since:
- 2.0
-