Package com.redwood.scheduler.api.model
Interface TimeWindow
- 
- All Superinterfaces:
- ApplicationObject,- BusinessKeyObject,- NamedRootObject,- NamedRootObjectComp,- PartitionableObject,- PartitionableObjectComp,- Readable,- Root,- SchedulerEntity,- SchedulerEntityComp,- TimeWindowComp,- UniqueNamedApplicationObject
 
 public interface TimeWindow extends TimeWindowComp, UniqueNamedApplicationObject, Readable Represents a period in time [start-moment, end-moment) defined as a union of TimeWindowIntervals. Time window is open when any of its child time window intervals is open. Time window with zero intervals is always closed. The open periods of the "enabled during" time window are intersected with the periods that are defined by the time window elements. The open periods of the "disabled during" time window are subtracted from the open periods of the time window.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringOBJECT_TYPEString that will be returned fromSchedulerEntity.getObjectType()for "TimeWindow" objects.static StringSEC_PRIV_CREATEThis privilege can be granted at a group level.static StringSEC_PRIV_DELETEThis privilege can be granted at a group level.static StringSEC_PRIV_EDITThis privilege can be granted at a group level.static StringSEC_PRIV_VIEWThis privilege can be granted at a group level.static StringSEC_RANK_ALLThis rank is made of the following privileges: create , view , edit , deletestatic StringSEC_RANK_CREATEThis rank is made of the following privileges: createstatic StringSEC_RANK_DELETEThis rank is made of the following privileges: create , view , deletestatic StringSEC_RANK_EDITThis rank is made of the following privileges: create , view , editstatic StringSEC_RANK_NONEThis rank has no privileges assigned to it.static StringSEC_RANK_VIEWThis rank is made of the following privileges: viewstatic QueryObjectType<TimeWindow>TYPEType that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...).- 
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntityACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Period>allStatusChanges(DateTimeZone startTime, DateTimeZone endTime, TimeZone defaultTimeZone)All changes of the open-close status of this time window.DateTimeZonecalculateNextClose(DateTimeZone startTime, TimeZone defaultTimeZone)Returns the next closing time.DateTimeZonecalculateNextOpen(DateTimeZone startTime, TimeZone defaultTimeZone)ReturnsstartTimeif the window is already open, or the next opening time.RequiredPermissioncheckCreatePrivilege()Check whether or not the create action can be performed on this object.RequiredPermissioncheckDeletePrivilege()Check whether or not the delete action can be performed on this object.RequiredPermissioncheckEditPrivilege()Check whether or not the edit action can be performed on this object.RequiredPermissioncheckViewPrivilege()Check whether or not the view action can be performed on this object.TimeWindowElementcreateTimeWindowElement()Create a newTimeWindowElementlinked to this object.Stringdescribe()Human-readable description of the intervalTimeWindowgetDayShiftCalendarTimeWindow()Get the DayShiftCalendarTimeWindow.LonggetDayShiftOffset()Get the value for DayShiftOffset.TimeWindowgetDisabledDuringTimeWindow()Get the DisabledDuringTimeWindow.TimeWindowgetEnabledDuringTimeWindow()Get the EnabledDuringTimeWindow.TimeWindowgetEnabledOrShiftCalendarTimeWindow()Get the EnabledOrShiftCalendarTimeWindow.RWIterable<TimeWindowElement>getTimeWindowElements()Get anRWIterableover an ordered collection ofTimeWindowElements.TimeZonegetTimeZone()Get the TimeZone.booleanisIsCalendar()Get the value for IsCalendar.booleanisOpen(DateTimeZone atTime, TimeZone defaultTimeZone)Returns status of this time window atatTimebooleanisSubmitTime()Get the value for SubmitTime.voidsetDayShiftCalendarTimeWindow(TimeWindow newDayShiftCalendarTimeWindow)Set the value for DayShiftCalendarTimeWindow.voidsetDayShiftOffset(Long newDayShiftOffset)Set the value for DayShiftOffset.voidsetDisabledDuringTimeWindow(TimeWindow newDisabledDuringTimeWindow)Set the value for DisabledDuringTimeWindow.voidsetEnabledDuringTimeWindow(TimeWindow newEnabledDuringTimeWindow)Set the value for EnabledDuringTimeWindow.voidsetEnabledOrShiftCalendarTimeWindow(TimeWindow newEnabledOrShiftCalendarTimeWindow)Set the value for EnabledOrShiftCalendarTimeWindow.voidsetIsCalendar(boolean newIsCalendar)Set the value for IsCalendar.voidsetSubmitTime(boolean newSubmitTime)Set the value for SubmitTime.voidsetTimeZone(TimeZone newTimeZone)Set the value for TimeZone.- 
Methods inherited from interface com.redwood.scheduler.api.model.ApplicationObjectgetParentApplication, setParentApplication
 - 
Methods inherited from interface com.redwood.scheduler.api.model.BusinessKeyObjectgetBusinessKey
 - 
Methods inherited from interface com.redwood.scheduler.api.model.NamedRootObjectcreateObjectReference, getComment, getDescription, getLinkedObjectReferenceByLinkedObject, getLinkedObjectReferenceByName, getLinkedObjectReferences, getName, getSearchName, getSourceObjectReferences, isHidden, setComment, setDescription, setName
 - 
Methods inherited from interface com.redwood.scheduler.api.model.PartitionableObjectcreateObjectTag, getEditablePartitions, getObjectTagByObjectTagDefinition, getObjectTags, getPartition, setPartition
 - 
Methods inherited from interface com.redwood.scheduler.api.model.RootgetCreationTime, getLastModificationTime, getLastModifierSubject
 - 
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntitycanPerform, createSubjectObjectPrivilegeGrant, deleteObject, getAuditTrail, getAuditTrailSize, getBehavior, getEffectiveBehavior, getErrorNameEN, getErrorNameKey, getLLPVersion, getLOV, getLOVSupport, getObjectType, getParentSchedulerEntities, getRuntime, getSubjectObjectPrivilegeGrantBySubject, getSubjectObjectPrivilegeGrants, getUniqueId, getUrl, getUrl, isCreated, isDeletable, isDeleted, isModifiable, isModified, isSelectVersioned, processRelatedObjects, processRelatedObjects, processRelatedObjects, refreshObject, resetObject, resetObject, resetValuesToDefault, selectForRead
 
- 
 
- 
- 
- 
Field Detail- 
OBJECT_TYPEstatic final String OBJECT_TYPE String that will be returned fromSchedulerEntity.getObjectType()for "TimeWindow" objects.- See Also:
- Constant Field Values
 
 - 
TYPEstatic final QueryObjectType<TimeWindow> TYPE Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...).
 - 
SEC_PRIV_CREATEstatic final String SEC_PRIV_CREATE This privilege can be granted at a group level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_VIEWstatic final String SEC_PRIV_VIEW This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_EDITstatic final String SEC_PRIV_EDIT This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_PRIV_DELETEstatic final String SEC_PRIV_DELETE This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
 
 - 
SEC_RANK_NONEstatic final String SEC_RANK_NONE This rank has no privileges assigned to it.- See Also:
- Constant Field Values
 
 - 
SEC_RANK_CREATEstatic final String SEC_RANK_CREATE This rank is made of the following privileges: create- See Also:
- Constant Field Values
 
 - 
SEC_RANK_VIEWstatic final String SEC_RANK_VIEW This rank is made of the following privileges: view- See Also:
- Constant Field Values
 
 - 
SEC_RANK_EDITstatic final String SEC_RANK_EDIT This rank is made of the following privileges: create , view , edit- See Also:
- Constant Field Values
 
 - 
SEC_RANK_DELETEstatic final String SEC_RANK_DELETE This rank is made of the following privileges: create , view , delete- See Also:
- Constant Field Values
 
 - 
SEC_RANK_ALLstatic final String SEC_RANK_ALL This rank is made of the following privileges: create , view , edit , delete- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
isIsCalendarboolean isIsCalendar() Get the value for IsCalendar. (Whether this time window is allowed to contain time or time zone information.)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
isSubmitTimeboolean isSubmitTime() Get the value for SubmitTime. (Must be set to true if this time window is created at submit time.)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
getDayShiftOffsetLong getDayShiftOffset() Get the value for DayShiftOffset. (The number of days to shift using theDayShiftCalendaron days thatEnabledOrShiftCalendaris closed.)- Returns:
- the field
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setIsCalendarvoid setIsCalendar(boolean newIsCalendar) Set the value for IsCalendar. (Whether this time window is allowed to contain time or time zone information.)- Parameters:
- newIsCalendar- the new value for IsCalendar.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setSubmitTimevoid setSubmitTime(boolean newSubmitTime) Set the value for SubmitTime. (Must be set to true if this time window is created at submit time.)- Parameters:
- newSubmitTime- the new value for SubmitTime.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
setDayShiftOffsetvoid setDayShiftOffset(Long newDayShiftOffset) Set the value for DayShiftOffset. (The number of days to shift using theDayShiftCalendaron days thatEnabledOrShiftCalendaris closed.) This value is optional.- Parameters:
- newDayShiftOffset- the new value for DayShiftOffset.
- Throws:
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- This will be thrown if this method is called while the object is not attached to a session.
 
 - 
allStatusChangesList<Period> allStatusChanges(DateTimeZone startTime, DateTimeZone endTime, TimeZone defaultTimeZone) throws com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation All changes of the open-close status of this time window. Returns all status changes of the window in the period AFTERstartTimeand BEFOREendTime.- Parameters:
- startTime- Starting time stamp
- endTime- Ending time stamp
- defaultTimeZone- The TimeZone to use if the TimeWindow does not specify a TimeZone. The result will be in this time zone.
- Returns:
- Sorted list with status changes between (startTime,endTime) in the default time zone
- Throws:
- com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation- No timezone could be found to calculate this TimeWindowElement. This means that the object that includes the TimeWindow should set the TimeZone to use for the calculation of the TimeWindow, or a TimeZone must be set on the TimeWindow or TimeWindowElement.
 
 - 
calculateNextOpenDateTimeZone calculateNextOpen(DateTimeZone startTime, TimeZone defaultTimeZone) throws com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation ReturnsstartTimeif the window is already open, or the next opening time. Returnsnullif the window does not open in the next 2 years.- Parameters:
- startTime- As of what time stamp
- defaultTimeZone- The TimeZone to use if the TimeWindow does not specify a TimeZone. The result will be in this time zone.
- Returns:
- Opening time in the default time zone or null
- Throws:
- com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation- No timezone could be found to calculate this TimeWindowElement. This means that the object that includes the TimeWindow should set the TimeZone to use for the calculation of the TimeWindow, or a TimeZone must be set on the TimeWindow or TimeWindowElement.
 
 - 
calculateNextCloseDateTimeZone calculateNextClose(DateTimeZone startTime, TimeZone defaultTimeZone) throws com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation Returns the next closing time. Returnsnullif the window does not close in the next 2 years. Raises exception if the window is not open atstartTime.- Parameters:
- startTime- as of what date
- defaultTimeZone- The TimeZone to use if the TimeWindow does not specify a TimeZone. The result will be in this time zone.
- Returns:
- closing time in default time zone, or null
- Throws:
- com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation- No timezone could be found to calculate this TimeWindowElement. This means that the object that includes the TimeWindow should set the TimeZone to use for the calculation of the TimeWindow, or a TimeZone must be set on the TimeWindow or TimeWindowElement.
 
 - 
isOpenboolean isOpen(DateTimeZone atTime, TimeZone defaultTimeZone) throws com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation Returns status of this time window atatTime- Parameters:
- atTime- as of what time stamp
- defaultTimeZone- The TimeZone to use if the TimeWindow does not specify a TimeZone
- Returns:
- Is open?
- Throws:
- com.redwood.scheduler.api.exception.NoTimeZoneForTimeWindowCalculation- No timezone could be found to calculate this TimeWindowElement. This means that the object that includes the TimeWindow should set the TimeZone to use for the calculation of the TimeWindow, or a TimeZone must be set on the TimeWindow or TimeWindowElement.
 
 - 
describeString describe() Human-readable description of the interval- Returns:
- text
 
 - 
getDisabledDuringTimeWindowTimeWindow getDisabledDuringTimeWindow() Get the DisabledDuringTimeWindow.- Returns:
- DisabledDuringTimeWindow
- Throws:
- com.redwood.scheduler.api.exception.ObjectDeletedException- If this method is called when the object has been marked for deletion.
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- If this method is called when the object has been removed from it's session.
 
 - 
getEnabledDuringTimeWindowTimeWindow getEnabledDuringTimeWindow() Get the EnabledDuringTimeWindow.- Returns:
- EnabledDuringTimeWindow
- Throws:
- com.redwood.scheduler.api.exception.ObjectDeletedException- If this method is called when the object has been marked for deletion.
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- If this method is called when the object has been removed from it's session.
 
 - 
getEnabledOrShiftCalendarTimeWindowTimeWindow getEnabledOrShiftCalendarTimeWindow() Get the EnabledOrShiftCalendarTimeWindow.- Returns:
- EnabledOrShiftCalendarTimeWindow
- Throws:
- com.redwood.scheduler.api.exception.ObjectDeletedException- If this method is called when the object has been marked for deletion.
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- If this method is called when the object has been removed from it's session.
 
 - 
getDayShiftCalendarTimeWindowTimeWindow getDayShiftCalendarTimeWindow() Get the DayShiftCalendarTimeWindow.- Returns:
- DayShiftCalendarTimeWindow
- Throws:
- com.redwood.scheduler.api.exception.ObjectDeletedException- If this method is called when the object has been marked for deletion.
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- If this method is called when the object has been removed from it's session.
 
 - 
getTimeZoneTimeZone getTimeZone() Get the TimeZone.- Returns:
- TimeZone
- Throws:
- com.redwood.scheduler.api.exception.ObjectDeletedException- If this method is called when the object has been marked for deletion.
- com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException- If this method is called when the object has been removed from it's session.
 
 - 
setDisabledDuringTimeWindowvoid setDisabledDuringTimeWindow(TimeWindow newDisabledDuringTimeWindow) Set the value for DisabledDuringTimeWindow. This value is optional.- Parameters:
- newDisabledDuringTimeWindow- is the object to set DisabledDuringTimeWindow to. A time window during which a time window interval is closed. The closed times are subtracted from the periods the time window is enabled because of time window elements and the "enabled during" time window.
 
 - 
setEnabledDuringTimeWindowvoid setEnabledDuringTimeWindow(TimeWindow newEnabledDuringTimeWindow) Set the value for EnabledDuringTimeWindow. This value is optional.- Parameters:
- newEnabledDuringTimeWindow- is the object to set EnabledDuringTimeWindow to. A time window during which a time window interval is open. The periods the "enabled during" time window is open are intersected with the periods that are defined by the time window elements.
 
 - 
setEnabledOrShiftCalendarTimeWindowvoid setEnabledOrShiftCalendarTimeWindow(TimeWindow newEnabledOrShiftCalendarTimeWindow) Set the value for EnabledOrShiftCalendarTimeWindow. This value is optional.- Parameters:
- newEnabledOrShiftCalendarTimeWindow- is the object to set EnabledOrShiftCalendarTimeWindow to. A Calendar that defines the days on which the time window is valid. If the Calendar is closed, the opening will be shifted- DayShiftOffsetopen days in- DayShiftCalendar.
 
 - 
setDayShiftCalendarTimeWindowvoid setDayShiftCalendarTimeWindow(TimeWindow newDayShiftCalendarTimeWindow) Set the value for DayShiftCalendarTimeWindow. This value is optional.- Parameters:
- newDayShiftCalendarTimeWindow- is the object to set DayShiftCalendarTimeWindow to. Defines the days that count for the- DayShiftOffsetwhen shifting is needed because- EnabledOrShiftCalendaris closed.
 
 - 
setTimeZonevoid setTimeZone(TimeZone newTimeZone) Set the value for TimeZone. This value is optional.- Parameters:
- newTimeZone- is the object to set TimeZone to. The default timezone for the intervals if they do not specify one
 
 - 
getTimeWindowElementsRWIterable<TimeWindowElement> getTimeWindowElements() Get anRWIterableover an ordered collection ofTimeWindowElements. If the collection is empty, an empty iterator will be returned, that is, this method will never returnnull. The intervals that make up a time window- Specified by:
- getTimeWindowElementsin interface- TimeWindowComp
- Returns:
- An RWIterableover an ordered collection ofTimeWindowElementobjects .
 
 - 
createTimeWindowElementTimeWindowElement createTimeWindowElement() Create a newTimeWindowElementlinked to this object.- Returns:
- a new TimeWindowElement.
 
 - 
checkCreatePrivilegeRequiredPermission checkCreatePrivilege() Check whether or not the create action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkViewPrivilegeRequiredPermission checkViewPrivilege() Check whether or not the view action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkEditPrivilegeRequiredPermission checkEditPrivilege() Check whether or not the edit action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 - 
checkDeletePrivilegeRequiredPermission checkDeletePrivilege() Check whether or not the delete action can be performed on this object.- Returns:
- a RequiredPermissioninstance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
 
 
- 
 
-