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 Summary
Fields Modifier and Type Field Description static String
OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "TimeWindow" objects.static String
SEC_PRIV_CREATE
This privilege can be granted at a group level.static String
SEC_PRIV_DELETE
This privilege can be granted at a group level.static String
SEC_PRIV_EDIT
This privilege can be granted at a group level.static String
SEC_PRIV_VIEW
This privilege can be granted at a group level.static String
SEC_RANK_ALL
This rank is made of the following privileges: create , view , edit , deletestatic String
SEC_RANK_CREATE
This rank is made of the following privileges: createstatic String
SEC_RANK_DELETE
This rank is made of the following privileges: create , view , deletestatic String
SEC_RANK_EDIT
This rank is made of the following privileges: create , view , editstatic String
SEC_RANK_NONE
This rank has no privileges assigned to it.static String
SEC_RANK_VIEW
This rank is made of the following privileges: viewstatic QueryObjectType<TimeWindow>
TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.-
Fields inherited from interface com.redwood.scheduler.api.model.BusinessKeyObject
COPYRIGHT_MESSAGE_BKO, ID_BKO
-
Fields inherited from interface com.redwood.scheduler.api.model.Readable
COPYRIGHT_MESSAGE_E, ID_E
-
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
ACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM
-
-
Method Summary
All 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.DateTimeZone
calculateNextClose(DateTimeZone startTime, TimeZone defaultTimeZone)
Returns the next closing time.DateTimeZone
calculateNextOpen(DateTimeZone startTime, TimeZone defaultTimeZone)
ReturnsstartTime
if the window is already open, or the next opening time.RequiredPermission
checkCreatePrivilege()
Check whether or not the create action can be performed on this object.RequiredPermission
checkDeletePrivilege()
Check whether or not the delete action can be performed on this object.RequiredPermission
checkEditPrivilege()
Check whether or not the edit action can be performed on this object.RequiredPermission
checkViewPrivilege()
Check whether or not the view action can be performed on this object.TimeWindowElement
createTimeWindowElement()
Create a newTimeWindowElement
linked to this object.String
describe()
Human-readable description of the intervalTimeWindow
getDayShiftCalendarTimeWindow()
Get the DayShiftCalendarTimeWindow.Long
getDayShiftOffset()
Get the value for DayShiftOffset.TimeWindow
getDisabledDuringTimeWindow()
Get the DisabledDuringTimeWindow.TimeWindow
getEnabledDuringTimeWindow()
Get the EnabledDuringTimeWindow.TimeWindow
getEnabledOrShiftCalendarTimeWindow()
Get the EnabledOrShiftCalendarTimeWindow.RWIterable<TimeWindowElement>
getTimeWindowElements()
Get anRWIterable
over an ordered collection ofTimeWindowElements
.TimeZone
getTimeZone()
Get the TimeZone.boolean
isIsCalendar()
Get the value for IsCalendar.boolean
isOpen(DateTimeZone atTime, TimeZone defaultTimeZone)
Returns status of this time window atatTime
boolean
isSubmitTime()
Get the value for SubmitTime.void
setDayShiftCalendarTimeWindow(TimeWindow newDayShiftCalendarTimeWindow)
Set the value for DayShiftCalendarTimeWindow.void
setDayShiftOffset(Long newDayShiftOffset)
Set the value for DayShiftOffset.void
setDisabledDuringTimeWindow(TimeWindow newDisabledDuringTimeWindow)
Set the value for DisabledDuringTimeWindow.void
setEnabledDuringTimeWindow(TimeWindow newEnabledDuringTimeWindow)
Set the value for EnabledDuringTimeWindow.void
setEnabledOrShiftCalendarTimeWindow(TimeWindow newEnabledOrShiftCalendarTimeWindow)
Set the value for EnabledOrShiftCalendarTimeWindow.void
setIsCalendar(boolean newIsCalendar)
Set the value for IsCalendar.void
setSubmitTime(boolean newSubmitTime)
Set the value for SubmitTime.void
setTimeZone(TimeZone newTimeZone)
Set the value for TimeZone.-
Methods inherited from interface com.redwood.scheduler.api.model.ApplicationObject
getParentApplication, setParentApplication
-
Methods inherited from interface com.redwood.scheduler.api.model.BusinessKeyObject
getBusinessKey
-
Methods inherited from interface com.redwood.scheduler.api.model.NamedRootObject
createObjectReference, getComment, getDescription, getLinkedObjectReferenceByLinkedObject, getLinkedObjectReferenceByName, getLinkedObjectReferences, getName, getSearchName, getSourceObjectReferences, isHidden, setComment, setDescription, setName
-
Methods inherited from interface com.redwood.scheduler.api.model.PartitionableObject
createObjectTag, getEditablePartitions, getObjectTagByObjectTagDefinition, getObjectTags, getPartition, setPartition
-
Methods inherited from interface com.redwood.scheduler.api.model.Root
getCreationTime, getLastModificationTime, getLastModifierSubject
-
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
canPerform, 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_TYPE
static final String OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "TimeWindow" objects.- See Also:
- Constant Field Values
-
TYPE
static final QueryObjectType<TimeWindow> TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.
-
SEC_PRIV_CREATE
static final String SEC_PRIV_CREATE
This privilege can be granted at a group level.- See Also:
- Constant Field Values
-
SEC_PRIV_VIEW
static 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_EDIT
static 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_DELETE
static 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_NONE
static final String SEC_RANK_NONE
This rank has no privileges assigned to it.- See Also:
- Constant Field Values
-
SEC_RANK_CREATE
static final String SEC_RANK_CREATE
This rank is made of the following privileges: create- See Also:
- Constant Field Values
-
SEC_RANK_VIEW
static final String SEC_RANK_VIEW
This rank is made of the following privileges: view- See Also:
- Constant Field Values
-
SEC_RANK_EDIT
static final String SEC_RANK_EDIT
This rank is made of the following privileges: create , view , edit- See Also:
- Constant Field Values
-
SEC_RANK_DELETE
static final String SEC_RANK_DELETE
This rank is made of the following privileges: create , view , delete- See Also:
- Constant Field Values
-
SEC_RANK_ALL
static final String SEC_RANK_ALL
This rank is made of the following privileges: create , view , edit , delete- See Also:
- Constant Field Values
-
-
Method Detail
-
isIsCalendar
boolean isIsCalendar()
Get the value for IsCalendar. (Whether this time window is allowed to contain time or time zone information.)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
isSubmitTime
boolean isSubmitTime()
Get the value for SubmitTime. (Must be set to true if this time window is created at submit time.)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getDayShiftOffset
Long getDayShiftOffset()
Get the value for DayShiftOffset. (The number of days to shift using theDayShiftCalendar
on days thatEnabledOrShiftCalendar
is closed.)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setIsCalendar
void 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:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setSubmitTime
void 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:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setDayShiftOffset
void setDayShiftOffset(Long newDayShiftOffset)
Set the value for DayShiftOffset. (The number of days to shift using theDayShiftCalendar
on days thatEnabledOrShiftCalendar
is closed.) This value is optional.- Parameters:
newDayShiftOffset
- the new value for DayShiftOffset.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
allStatusChanges
List<Period> allStatusChanges(DateTimeZone startTime, DateTimeZone endTime, TimeZone defaultTimeZone) throws NoTimeZoneForTimeWindowCalculation
All changes of the open-close status of this time window. Returns all status changes of the window in the period AFTERstartTime
and BEFOREendTime
.- Parameters:
startTime
- Starting time stampendTime
- Ending time stampdefaultTimeZone
- 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:
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.
-
calculateNextOpen
DateTimeZone calculateNextOpen(DateTimeZone startTime, TimeZone defaultTimeZone) throws NoTimeZoneForTimeWindowCalculation
ReturnsstartTime
if the window is already open, or the next opening time. Returnsnull
if the window does not open in the next 2 years.- Parameters:
startTime
- As of what time stampdefaultTimeZone
- 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:
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.
-
calculateNextClose
DateTimeZone calculateNextClose(DateTimeZone startTime, TimeZone defaultTimeZone) throws NoTimeZoneForTimeWindowCalculation
Returns the next closing time. Returnsnull
if the window does not close in the next 2 years. Raises exception if the window is not open atstartTime
.- Parameters:
startTime
- as of what datedefaultTimeZone
- 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:
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.
-
isOpen
boolean isOpen(DateTimeZone atTime, TimeZone defaultTimeZone) throws NoTimeZoneForTimeWindowCalculation
Returns status of this time window atatTime
- Parameters:
atTime
- as of what time stampdefaultTimeZone
- The TimeZone to use if the TimeWindow does not specify a TimeZone- Returns:
- Is open?
- Throws:
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.
-
describe
String describe()
Human-readable description of the interval- Returns:
- text
-
getDisabledDuringTimeWindow
TimeWindow getDisabledDuringTimeWindow()
Get the DisabledDuringTimeWindow.- Returns:
- DisabledDuringTimeWindow
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getEnabledDuringTimeWindow
TimeWindow getEnabledDuringTimeWindow()
Get the EnabledDuringTimeWindow.- Returns:
- EnabledDuringTimeWindow
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getEnabledOrShiftCalendarTimeWindow
TimeWindow getEnabledOrShiftCalendarTimeWindow()
Get the EnabledOrShiftCalendarTimeWindow.- Returns:
- EnabledOrShiftCalendarTimeWindow
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getDayShiftCalendarTimeWindow
TimeWindow getDayShiftCalendarTimeWindow()
Get the DayShiftCalendarTimeWindow.- Returns:
- DayShiftCalendarTimeWindow
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getTimeZone
TimeZone getTimeZone()
Get the TimeZone.- Returns:
- TimeZone
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
setDisabledDuringTimeWindow
void 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.
-
setEnabledDuringTimeWindow
void 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.
-
setEnabledOrShiftCalendarTimeWindow
void 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 shiftedDayShiftOffset
open days inDayShiftCalendar
.
-
setDayShiftCalendarTimeWindow
void 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 theDayShiftOffset
when shifting is needed becauseEnabledOrShiftCalendar
is closed.
-
setTimeZone
void 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
-
getTimeWindowElements
RWIterable<TimeWindowElement> getTimeWindowElements()
Get anRWIterable
over 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:
getTimeWindowElements
in interfaceTimeWindowComp
- Returns:
- An
RWIterable
over an ordered collection ofTimeWindowElement
objects .
-
createTimeWindowElement
TimeWindowElement createTimeWindowElement()
Create a newTimeWindowElement
linked to this object.- Returns:
- a new
TimeWindowElement
.
-
checkCreatePrivilege
RequiredPermission checkCreatePrivilege()
Check whether or not the create action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkViewPrivilege
RequiredPermission checkViewPrivilege()
Check whether or not the view action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkEditPrivilege
RequiredPermission checkEditPrivilege()
Check whether or not the edit action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkDeletePrivilege
RequiredPermission checkDeletePrivilege()
Check whether or not the delete action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
-