Package com.uc4.api.objects
Class Period
- java.lang.Object
-
- com.uc4.api.objects.UC4Object
-
- com.uc4.api.objects.Period
-
public class Period extends UC4Object
An object that holds settings that may be used for periodic execution of tasks. It allows to define the time periods once and reuse this information to start multiple periodic executions.Usage Example:
Period period = (Period) open("NAME.OF.PERIOD.OBJECT"); //Create a ExecuteRecurring instance with the settings from the Period object. ExecuteRecurring er = period.createExecuteRecurring(); executeObject.executeRecurring(er);
-
-
Constructor Summary
Constructors Constructor Description Period()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ExecuteRecurringcreateExecuteRecurring()Creates a newExecuteRecurringinstance with the settings copied from this Period object.TaskCalendargetCalendarCondition()Deprecated.Use getExecuteRecurring() insteadintgetDateRangeRuns()Deprecated.Use getExecuteRecurring() insteadExecuteRecurringgetExecuteRecurring()This method will return theExecuteRecurringdetails.intgetExecutionInterval()Deprecated.Use getExecuteRecurring() insteadintgetGapInterval()Deprecated.Use getExecuteRecurring() insteadDateTimegetRangeEndDate()Deprecated.Use getExecuteRecurring() insteadDateTimegetRangeStartDate()Deprecated.Use getExecuteRecurring() insteadTimegetTimeframeEnd()Deprecated.Use getExecuteRecurring() insteadTimegetTimeframeStart()Deprecated.Use getExecuteRecurring() insteadTimegetTimeOfSingleExecution()Deprecated.Use getExecuteRecurring() insteadbooleanhasDateRangeRuns()Deprecated.Use getExecuteRecurring() insteadbooleanhasDateRangeWithEndTime()Deprecated.Use getExecuteRecurring() insteadbooleanhasDateRangeWithoutEnd()Deprecated.Use getExecuteRecurring() insteadbooleanhasTimeframeAdjustment()Deprecated.Use getExecuteRecurring() insteadHeaderheader()Returns the header data of this object.booleanisAllowOneOverlap()Deprecated.Use getExecuteRecurring() insteadbooleanisExecutable()Returnstrueif this Object can be executed.booleanisExecutedAtTime()Deprecated.Use getExecuteRecurring() insteadbooleanisExecutedInterval()Deprecated.Use getExecuteRecurring() insteadbooleanisExecutedWithGap()Deprecated.Use getExecuteRecurring() insteadbooleanisFriday()Deprecated.Use getExecuteRecurring() insteadbooleanisMonday()Deprecated.Use getExecuteRecurring() insteadbooleanisSaturday()Deprecated.Use getExecuteRecurring() insteadbooleanisSunday()Deprecated.Use getExecuteRecurring() insteadbooleanisThursday()Deprecated.Use getExecuteRecurring() insteadbooleanisTuesday()Deprecated.Use getExecuteRecurring() insteadbooleanisWednesday()Deprecated.Use getExecuteRecurring() insteadbooleanrunsOnDefinedCalendar()Deprecated.Use getExecuteRecurring() insteadbooleanrunsOnDefinedWeekdays()Deprecated.Use getExecuteRecurring() insteadvoidsetAllowOneOverlap(boolean overlap)Deprecated.Use setExecuteRecurring() insteadvoidsetAtTime(Time time)Deprecated.Use setExecuteRecurring() insteadvoidsetCalendarCondition(TaskCalendar calendar)Deprecated.Use setExecuteRecurring() insteadvoidsetDateRange(DateTime startDate, int runs)Deprecated.Use setExecuteRecurring() insteadvoidsetDateRange(DateTime startDate, DateTime endDate)Deprecated.Use setExecuteRecurring() insteadvoidsetExecuteRecurring(ExecuteRecurring executeRecurring)This method is used to set theExecuteRecurringdetails.voidsetExecutionInterval(int every)Deprecated.Use setExecuteRecurring() insteadvoidsetGapToPreviousRun(int gap)Deprecated.Use setExecuteRecurring() insteadvoidsetRangeWithoutEnd(DateTime startDate)Deprecated.Use setExecuteRecurring() insteadvoidsetTimeframe(Time start, Time end, boolean forceAdjustment)Deprecated.Use setExecuteRecurring() insteadvoidsetWeekDays(boolean mo, boolean tu, boolean we, boolean th, boolean fr, boolean sa, boolean su)Deprecated.Use setExecuteRecurring() instead-
Methods inherited from class com.uc4.api.objects.UC4Object
docu, getAccess, getIdnr, getModCount, getName, getObjectClient, getType, isOldVersion, load, store, validate
-
-
-
-
Method Detail
-
header
public Header header()
Returns the header data of this object. This is the information of the header tab in the dialog client.- Returns:
- Header
-
isExecutable
public boolean isExecutable()
Description copied from class:UC4ObjectReturnstrueif this Object can be executed.- Specified by:
isExecutablein classUC4Object- Returns:
- true if the Object can be executed, false if not.
-
setTimeframe
@Deprecated public void setTimeframe(Time start, Time end, boolean forceAdjustment)
Deprecated.Use setExecuteRecurring() insteadSets the execution time frame.- Parameters:
start- Start timeend- End timeforceAdjustment- Aligns the start time on the time frame if set to true
-
getTimeframeStart
@Deprecated public Time getTimeframeStart()
Deprecated.Use getExecuteRecurring() insteadReturns the start time which was set using the methodsetTimeframe.- Returns:
- Start time of the Time frame
-
getTimeframeEnd
@Deprecated public Time getTimeframeEnd()
Deprecated.Use getExecuteRecurring() insteadReturns the end time which was set using the methodsetTimeframe.- Returns:
- End time of the Time frame
-
hasTimeframeAdjustment
@Deprecated public boolean hasTimeframeAdjustment()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if the start time is aligned to the time frame
-
setExecutionInterval
@Deprecated public void setExecutionInterval(int every)
Deprecated.Use setExecuteRecurring() insteadSets the execution interval in minutes.- Parameters:
every- Number of minutes of the execution interval
-
isExecutedInterval
@Deprecated public boolean isExecutedInterval()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns true if an execution interval has been set.
-
getExecutionInterval
@Deprecated public int getExecutionInterval()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns the execution interval in minutes.
-
setGapToPreviousRun
@Deprecated public void setGapToPreviousRun(int gap)
Deprecated.Use setExecuteRecurring() insteadSets the gap to the previous run of the task in minutes.- Parameters:
gap- Time gap in minutes
-
isExecutedWithGap
@Deprecated public boolean isExecutedWithGap()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns true if the interval has a gap to the previous run.
-
getGapInterval
@Deprecated public int getGapInterval()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns the time gap in minutes to the previous run.
-
setAtTime
@Deprecated public void setAtTime(Time time)
Deprecated.Use setExecuteRecurring() insteadSets the start time of the task.- Parameters:
time- Start time
-
getTimeOfSingleExecution
@Deprecated public Time getTimeOfSingleExecution()
Deprecated.Use getExecuteRecurring() insteadReturns the start time that has been set using the methodsetAtTime.- Returns:
- Start time of the execution
-
isExecutedAtTime
@Deprecated public boolean isExecutedAtTime()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns true if the task is executed at a defined time (the method setAtTime has been called before)
-
setAllowOneOverlap
@Deprecated public void setAllowOneOverlap(boolean overlap)
Deprecated.Use setExecuteRecurring() insteadSets if one overlap should be allowed. If the parameteroverlapis set tofalsethere will only be one task at one time even if the old run has not finished.- Parameters:
overlap- True if one overlap is allowed
-
isAllowOneOverlap
@Deprecated public boolean isAllowOneOverlap()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns True if one overlap is allowed
-
setDateRange
@Deprecated public void setDateRange(DateTime startDate, DateTime endDate)
Deprecated.Use setExecuteRecurring() insteadSets the date range for the interval.- Parameters:
startDate- Start dateendDate- End date
-
hasDateRangeWithEndTime
@Deprecated public boolean hasDateRangeWithEndTime()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if a date range was specified using a start date and an end date
-
getRangeStartDate
@Deprecated public DateTime getRangeStartDate()
Deprecated.Use getExecuteRecurring() insteadReturns the start date of of the date range which has been set using the methodsetDateRange.- Returns:
- Start Date
-
getRangeEndDate
@Deprecated public DateTime getRangeEndDate()
Deprecated.Use getExecuteRecurring() insteadReturns the end date of the date range which has been set using the methodsetDateRange.- Returns:
- End date
-
setRangeWithoutEnd
@Deprecated public void setRangeWithoutEnd(DateTime startDate)
Deprecated.Use setExecuteRecurring() insteadSets a date range with a start date and an open end date.- Parameters:
startDate- start date
-
hasDateRangeWithoutEnd
@Deprecated public boolean hasDateRangeWithoutEnd()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns true if the date range was specified only by a start date
-
setDateRange
@Deprecated public void setDateRange(DateTime startDate, int runs)
Deprecated.Use setExecuteRecurring() insteadSets a date range using a start date and a number of runs.- Parameters:
startDate- Start dateruns- Number of run
-
getDateRangeRuns
@Deprecated public int getDateRangeRuns()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns the number of runs of the date range.
-
hasDateRangeRuns
@Deprecated public boolean hasDateRangeRuns()
Deprecated.Use getExecuteRecurring() instead- Returns:
- Returns true if the date range was specified using a start date and a number of runs.
-
setCalendarCondition
@Deprecated public void setCalendarCondition(TaskCalendar calendar)
Deprecated.Use setExecuteRecurring() insteadSets the calendar condition of the recurring tasks.- Parameters:
calendar- Calendar condition
-
getCalendarCondition
@Deprecated public TaskCalendar getCalendarCondition()
Deprecated.Use getExecuteRecurring() insteadReturns the calendar condition which has been set using the methodsetCalendarCondition.- Returns:
- Calendar condition
-
setWeekDays
@Deprecated public void setWeekDays(boolean mo, boolean tu, boolean we, boolean th, boolean fr, boolean sa, boolean su)Deprecated.Use setExecuteRecurring() insteadSets Weekdays.- Parameters:
mo- Mondaytu- Tuesdaywe- Wednesdayth- Thursdayfr- Fridaysa- Saturdaysu- Sunday
-
runsOnDefinedWeekdays
@Deprecated public boolean runsOnDefinedWeekdays()
Deprecated.Use getExecuteRecurring() insteadReturns true if the task runs on defined week days. This method returnstrueifsetWeekDayshas been called before.Note: When this method returns true, calls to
runsOnDefinedCalendar()will return false.- Returns:
- True if weekdays are used as calendar condition
-
runsOnDefinedCalendar
@Deprecated public boolean runsOnDefinedCalendar()
Deprecated.Use getExecuteRecurring() insteadReturns true if the task runs based on calendar conditions. This method returnstrueifsetCalendarCondition(TaskCalendar)has been called before.Note: When this method returns true, calls to
runsOnDefinedWeekdays()will return false.- Returns:
- Returns true if the task runs on defined calendar conditions
-
isSunday
@Deprecated public boolean isSunday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Sunday is selected and the task runs on weekdays
-
isMonday
@Deprecated public boolean isMonday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Monday is selected and the task runs on weekdays
-
isTuesday
@Deprecated public boolean isTuesday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Tuesday is selected and the task runs on weekdays
-
isWednesday
@Deprecated public boolean isWednesday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Wednesday is selected and the task runs on weekdays
-
isThursday
@Deprecated public boolean isThursday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Thursday is selected and the task runs on weekdays
-
isFriday
@Deprecated public boolean isFriday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Friday is selected and the task runs on weekdays
-
isSaturday
@Deprecated public boolean isSaturday()
Deprecated.Use getExecuteRecurring() instead- Returns:
- True if Saturday is selected and the task runs on weekdays
-
createExecuteRecurring
public ExecuteRecurring createExecuteRecurring()
Creates a newExecuteRecurringinstance with the settings copied from this Period object.The content of
header().getTitle() is transfered to the description field of the returnedExecuteRecurringobject.- Returns:
- A new ExecuteRecurring instance.
- Throws:
java.lang.IllegalArgumentException- Whenheader().getTitle() is longer than 255 characters.- See Also:
ExecuteRecurring.getPeriodDescription(),Header.getTitle()
-
setExecuteRecurring
public void setExecuteRecurring(ExecuteRecurring executeRecurring)
This method is used to set theExecuteRecurringdetails.- Parameters:
executeRecurring- ExecuteRecurring instance
-
getExecuteRecurring
public ExecuteRecurring getExecuteRecurring()
This method will return theExecuteRecurringdetails.- Returns:
- the execute recurring
-
-