Class TimeTriggerForCustomSettings
- java.lang.Object
-
- com.inet.taskplanner.server.api.trigger.time.AbstractTimeTrigger
-
- com.inet.taskplanner.server.api.trigger.time.TimeTriggerForCustomSettings
-
- All Implemented Interfaces:
Trigger
public class TimeTriggerForCustomSettings extends com.inet.taskplanner.server.api.trigger.time.AbstractTimeTrigger
Trigger implementation for theCUSTOM
settings of the time trigger.As there is only one trigger in the GUi and configuration, the
TimeTriggerFactory
will validate and create this kind of trigger in addition to the normalTimeTrigger
.As this is only indirectly supported in the public api, there is no Builder for this trigger. Use
TimeTrigger
withTimeTriggerBuilder
whenever possible.- Since:
- taskplanner 22.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.inet.taskplanner.server.api.trigger.Trigger
Trigger.TriggerAction
-
-
Field Summary
Fields Modifier and Type Field Description static int
CUSTOM_MONTHLY_DAY_DAY
On the [cardinality] daystatic int
CUSTOM_MONTHLY_DAY_WEEKDAY
On the [cardinality] weekday (Mo-Fr)static int
INTERVALTYPE_DAILY
Daily rhythmstatic int
INTERVALTYPE_MONTHLY
Monthly rhythmstatic int
INTERVALTYPE_WEEKLY
Weekly rhythmstatic java.lang.String
PROP_CUSTOM_INTERVAL
Every X weeks/days/months.static java.lang.String
PROP_CUSTOM_INTERVALTYPE
static java.lang.String
PROP_CUSTOM_MONTHLY_CARDINALITY
At which day (1st, 2nd, last etc).static java.lang.String
PROP_CUSTOM_MONTHLY_DAY_OF_MONTH
At which day to execute for monthly repetition.static java.lang.String
PROP_CUSTOM_WEEKLY_DAYOFWEEK
At which day of week.
-
Constructor Summary
Constructors Constructor Description TimeTriggerForCustomSettings(TriggerDefinition definition)
Create the trigger for given definition
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.time.ZonedDateTime>
calculateNextExecutionTime(java.time.ZonedDateTime lastExecutiontime)
static java.lang.String
generateNiceReadableSentenceForExecution(java.time.ZonedDateTime startDate, java.lang.String localizedStartTime, TriggerDefinition definition)
FOR INTERNAL USE ONLY.static int
getCardinalityFromSetting(java.time.ZonedDateTime startDate, MonthlyDay monthlyCardinality)
FOR INTERNAL USE ONLY.static java.util.List<java.time.ZonedDateTime>
getNextExecutionDates(TriggerDefinition definition)
FOR INTERNAL USE ONLY.protected java.lang.String
getTriggerDescribingStringForLog()
-
Methods inherited from class com.inet.taskplanner.server.api.trigger.time.AbstractTimeTrigger
activate, deactivate, runAction, triggerAction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inet.taskplanner.server.api.trigger.Trigger
activate, clearState
-
-
-
-
Field Detail
-
PROP_CUSTOM_INTERVALTYPE
public static final java.lang.String PROP_CUSTOM_INTERVALTYPE
- See Also:
- Constant Field Values
-
INTERVALTYPE_DAILY
public static final int INTERVALTYPE_DAILY
Daily rhythm- See Also:
- Constant Field Values
-
INTERVALTYPE_WEEKLY
public static final int INTERVALTYPE_WEEKLY
Weekly rhythm- See Also:
- Constant Field Values
-
INTERVALTYPE_MONTHLY
public static final int INTERVALTYPE_MONTHLY
Monthly rhythm- See Also:
- Constant Field Values
-
PROP_CUSTOM_INTERVAL
public static final java.lang.String PROP_CUSTOM_INTERVAL
Every X weeks/days/months. Must be 1 or greater.- See Also:
- Constant Field Values
-
PROP_CUSTOM_WEEKLY_DAYOFWEEK
public static final java.lang.String PROP_CUSTOM_WEEKLY_DAYOFWEEK
At which day of week. TypeDayOfWeek
.- See Also:
- Constant Field Values
-
PROP_CUSTOM_MONTHLY_CARDINALITY
public static final java.lang.String PROP_CUSTOM_MONTHLY_CARDINALITY
At which day (1st, 2nd, last etc).Type=
MonthlyDay
. This exists in conjunction withPROP_CUSTOM_MONTHLY_DAY_OF_MONTH
.- See Also:
- Constant Field Values
-
PROP_CUSTOM_MONTHLY_DAY_OF_MONTH
public static final java.lang.String PROP_CUSTOM_MONTHLY_DAY_OF_MONTH
At which day to execute for monthly repetition. Exists in conjunction withPROP_CUSTOM_MONTHLY_CARDINALITY
.Type=int, where the DaysOfWeek are equals to the number in
DayOfWeek
(Monday=1,Sunday=7), plusCUSTOM_MONTHLY_DAY_DAY
andCUSTOM_MONTHLY_DAY_WEEKDAY
are possible values.- See Also:
- Constant Field Values
-
CUSTOM_MONTHLY_DAY_DAY
public static final int CUSTOM_MONTHLY_DAY_DAY
On the [cardinality] day- See Also:
- Constant Field Values
-
CUSTOM_MONTHLY_DAY_WEEKDAY
public static final int CUSTOM_MONTHLY_DAY_WEEKDAY
On the [cardinality] weekday (Mo-Fr)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeTriggerForCustomSettings
public TimeTriggerForCustomSettings(TriggerDefinition definition)
Create the trigger for given definition- Parameters:
definition
- definition with settings for custom repeat.- Since:
- taskplanner 22.4
-
-
Method Detail
-
calculateNextExecutionTime
protected java.util.Optional<java.time.ZonedDateTime> calculateNextExecutionTime(java.time.ZonedDateTime lastExecutiontime)
- Specified by:
calculateNextExecutionTime
in classcom.inet.taskplanner.server.api.trigger.time.AbstractTimeTrigger
-
getTriggerDescribingStringForLog
protected java.lang.String getTriggerDescribingStringForLog()
- Specified by:
getTriggerDescribingStringForLog
in classcom.inet.taskplanner.server.api.trigger.time.AbstractTimeTrigger
-
getCardinalityFromSetting
public static int getCardinalityFromSetting(java.time.ZonedDateTime startDate, MonthlyDay monthlyCardinality)
FOR INTERNAL USE ONLY. get the cardinality setting (the nTh value) as int which we will then count down.- Parameters:
startDate
- start date setting (INITIAL)monthlyCardinality
- cardinality setting- Returns:
- the value
-
getNextExecutionDates
public static java.util.List<java.time.ZonedDateTime> getNextExecutionDates(TriggerDefinition definition)
FOR INTERNAL USE ONLY. Get some next execution dates.- Parameters:
definition
- settings of the trigger- Returns:
- the dates, empty if is invalid
-
generateNiceReadableSentenceForExecution
public static java.lang.String generateNiceReadableSentenceForExecution(java.time.ZonedDateTime startDate, java.lang.String localizedStartTime, TriggerDefinition definition)
FOR INTERNAL USE ONLY. Generate a nice sentence for custom time settings.- Parameters:
startDate
- start Date of the triggerlocalizedStartTime
- localized string with hour/minute of execution.definition
- the trigger definition settings- Returns:
- the string
- Throws:
java.lang.IllegalArgumentException
- if settings are invalid
-
-