Interface TimeWindow

    • 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 the DayShiftCalendar on days that EnabledOrShiftCalendar 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 the DayShiftCalendar on days that EnabledOrShiftCalendar 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 AFTER startTime and BEFORE endTime.
        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:
        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
        Returns startTime if the window is already open, or the next opening time. Returns null if 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:
        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. Returns null if the window does not close in the next 2 years. Raises exception if the window is not open at startTime.
        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:
        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 at atTime
        Parameters:
        atTime - as of what time stamp
        defaultTimeZone - 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.
      • 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 shifted DayShiftOffset open days in DayShiftCalendar.
      • 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 the DayShiftOffset when shifting is needed because EnabledOrShiftCalendar 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
      • 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.