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 ExecuteRecurring
createExecuteRecurring()
Creates a newExecuteRecurring
instance with the settings copied from this Period object.TaskCalendar
getCalendarCondition()
Deprecated.Use getExecuteRecurring() insteadint
getDateRangeRuns()
Deprecated.Use getExecuteRecurring() insteadExecuteRecurring
getExecuteRecurring()
This method will return theExecuteRecurring
details.int
getExecutionInterval()
Deprecated.Use getExecuteRecurring() insteadint
getGapInterval()
Deprecated.Use getExecuteRecurring() insteadDateTime
getRangeEndDate()
Deprecated.Use getExecuteRecurring() insteadDateTime
getRangeStartDate()
Deprecated.Use getExecuteRecurring() insteadTime
getTimeframeEnd()
Deprecated.Use getExecuteRecurring() insteadTime
getTimeframeStart()
Deprecated.Use getExecuteRecurring() insteadTime
getTimeOfSingleExecution()
Deprecated.Use getExecuteRecurring() insteadboolean
hasDateRangeRuns()
Deprecated.Use getExecuteRecurring() insteadboolean
hasDateRangeWithEndTime()
Deprecated.Use getExecuteRecurring() insteadboolean
hasDateRangeWithoutEnd()
Deprecated.Use getExecuteRecurring() insteadboolean
hasTimeframeAdjustment()
Deprecated.Use getExecuteRecurring() insteadHeader
header()
Returns the header data of this object.boolean
isAllowOneOverlap()
Deprecated.Use getExecuteRecurring() insteadboolean
isExecutable()
Returnstrue
if this Object can be executed.boolean
isExecutedAtTime()
Deprecated.Use getExecuteRecurring() insteadboolean
isExecutedInterval()
Deprecated.Use getExecuteRecurring() insteadboolean
isExecutedWithGap()
Deprecated.Use getExecuteRecurring() insteadboolean
isFriday()
Deprecated.Use getExecuteRecurring() insteadboolean
isMonday()
Deprecated.Use getExecuteRecurring() insteadboolean
isSaturday()
Deprecated.Use getExecuteRecurring() insteadboolean
isSunday()
Deprecated.Use getExecuteRecurring() insteadboolean
isThursday()
Deprecated.Use getExecuteRecurring() insteadboolean
isTuesday()
Deprecated.Use getExecuteRecurring() insteadboolean
isWednesday()
Deprecated.Use getExecuteRecurring() insteadboolean
runsOnDefinedCalendar()
Deprecated.Use getExecuteRecurring() insteadboolean
runsOnDefinedWeekdays()
Deprecated.Use getExecuteRecurring() insteadvoid
setAllowOneOverlap(boolean overlap)
Deprecated.Use setExecuteRecurring() insteadvoid
setAtTime(Time time)
Deprecated.Use setExecuteRecurring() insteadvoid
setCalendarCondition(TaskCalendar calendar)
Deprecated.Use setExecuteRecurring() insteadvoid
setDateRange(DateTime startDate, int runs)
Deprecated.Use setExecuteRecurring() insteadvoid
setDateRange(DateTime startDate, DateTime endDate)
Deprecated.Use setExecuteRecurring() insteadvoid
setExecuteRecurring(ExecuteRecurring executeRecurring)
This method is used to set theExecuteRecurring
details.void
setExecutionInterval(int every)
Deprecated.Use setExecuteRecurring() insteadvoid
setGapToPreviousRun(int gap)
Deprecated.Use setExecuteRecurring() insteadvoid
setRangeWithoutEnd(DateTime startDate)
Deprecated.Use setExecuteRecurring() insteadvoid
setTimeframe(Time start, Time end, boolean forceAdjustment)
Deprecated.Use setExecuteRecurring() insteadvoid
setWeekDays(boolean mo, boolean tu, boolean we, boolean th, boolean fr, boolean sa, boolean su)
Deprecated.Use setExecuteRecurring() instead
-
-
-
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:UC4Object
Returnstrue
if this Object can be executed.- Specified by:
isExecutable
in 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 parameteroverlap
is set tofalse
there 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 returnstrue
ifsetWeekDays
has 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 returnstrue
ifsetCalendarCondition(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 newExecuteRecurring
instance with the settings copied from this Period object.The content of
header()
.getTitle() is transfered to the description field of the returnedExecuteRecurring
object.- 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 theExecuteRecurring
details.- Parameters:
executeRecurring
- ExecuteRecurring instance
-
getExecuteRecurring
public ExecuteRecurring getExecuteRecurring()
This method will return theExecuteRecurring
details.- Returns:
- the execute recurring
-
-