Method Summary
|
addTrigger
(
|
Add triggers to a booking. |
|
addTriggerOnBookings
(
|
Add triggers to a number of bookings. If such a trigger is already define for a booking, no new trigger will be added. |
|
getBooking
(
|
Get information about a booking. |
|
getBookingIds
(
|
Get the bookings during start and stop time, with the same category. |
|
getBookingIdsForSeries
(
|
Get the bookings associated with a series. |
|
getConflicts
(
|
Detect conflicts without actually creating a booking. |
|
getNextStartTime
(
|
Get the expected starting time for next scheduled booking with matching category. |
|
getParameter
(
|
Get user defined parameters associated with a booking. |
|
getParameterNames
(
|
Get all user defined parameters names of a booking |
|
getSeries
(
|
Get the info of the series with a certain series identifier |
|
getSeriesConflicts
(
|
Detect conflicts for a new series booking or a series booking about to be rescheduled, but without actually booking any activities. |
|
getSeriesIds
(
|
Get the all series identifiers with the given category. |
|
getSeriesParameter
(
|
Get user defined parameters associated with a series. |
|
getSeriesParameterNames
(
|
Get all user defined parameters names associated with a series. |
|
getTriggers
(
|
Get triggers associated with a booking. |
|
remove
(
|
Remove a booking. |
|
removeSeries
(
|
Remove a booked recurrent scheduling. |
|
removeTrigger
(
|
Remove trigger from a booking. |
|
removeTriggerOnBookings
(
|
Remove triggers from a number of bookings. If there is no trigger with the specified delta - nothing will be changed for that booking. |
|
reschedule
(
|
Requests changing and rescheduling of a booking. |
|
schedule
(
|
Requests scheduling of a new booking. |
|
scheduleSeries
(
|
Requests scheduling of a recurrent booking. |
|
setCategorySubscription
(
|
This method is used to filter which categories the application is notified about. |
|
setParameter
(
|
Add user defined parameters to a booking. |
|
setParametersOnBookings
(
|
Add user defined parameters to a set of bookings. |
|
setSeriesParameter
(
|
Add user defined parameters to a scheduled series. |
|
unsetParameter
(
|
Remove user defined parameters from a booking. |
|
unsetSeriesParameter
(
|
Remove user defined parameters from a scheduled series. |
Inherited Methods
|
addEventListener
(
|
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners. |
|
removeEventListener
(
|
This method removes an event listener for a specific event. |
Type Definitions
|
Identifier for scheduler bookings. |
|
|
Conflict handling strategy to apply when trying to schedule a series that results in conflicts with previous bookings. |
|
|
Type representing time in seconds since start point of a certain booking. It might be negative to indicate a start point in the past. |
|
|
|
|
|
Identifier for a series of bookings. |
|
|
Conflict solution type. ToiSchedulerService.SOLUTION_TYPE_NONE means there is no solution and the booking is impossible. ToiSchedulerService.SOLUTION_TYPE_REMOVE means one or more solutions exist. |
|
|
Type representing time in seconds since the Unix epoch (1970-01-01 00:00:00). |
|
|
Type representing weekday masks. This is a bitwise OR between weekday constants. |
|
|
|
|
Events
Methods
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to subscribe to.
listenerToiEventListener The JavaScript function that will receive events.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
Add triggers to a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
deltaToiSchedulerService.ToiDelta The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Add triggers to a number of bookings. If such a trigger is already define for a booking, no new trigger will be added.
Parameters:
-
Name Type Description idsArray.<ToiSchedulerService.ToiBookingId> A sequence of booking identifiers that should use the new trigger.
deltaToiSchedulerService.ToiDelta The delta time in seconds since start point of a booking.
Throws:
-
ToiInvalidArgumentException Raised if one or more bookings can not be found.
Get information about a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier to find information about.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if can not find a booking with the identifier.
Returns:
-
Type: ToiSchedulerService.ToiBooking
The booking information.
Get the bookings during start and stop time, with the same category.
Parameters:
-
Name Type Description categoryExpressionstring The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.
startToiSchedulerService.ToiTime Start time of the booking in seconds since the Unix epoch. A value of 0 means no limit.
stopToiSchedulerService.ToiTime End time of the booking in seconds since the Unix epoch. A value of 0 means no limit.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if start is later than stop.
Returns:
-
Type: Array.<ToiSchedulerService.ToiBookingId>
The sequence of booking identifiers found.
Get the bookings associated with a series.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description seriesIdToiSchedulerService.ToiSeriesId The identifier of the series to retrieve bookings for
Throws:
-
ToiInvalidArgumentException Raised if the identifier does not exist.
Returns:
-
Type: Array.<ToiSchedulerService.ToiBookingId>
The sequence of booking identifiers found.
Detect conflicts without actually creating a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The identifier of the booking which need to be tested (in case of a rescheduling to be performed) or ToiSchedulerService.BOOKING_ID_NONE (in case of a new booking to be performed).
categorystring The category info for the attempted booking.
activitystring The activity type for the attempted booking.
startToiSchedulerService.ToiTime The start time for the attempted booking. Seconds since the Unix epoch.
durationnumber The duration time in seconds for the attempted booking.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the identifer cannot be found.
Returns:
-
Type: Array.<ToiSchedulerService.ToiSolution>
If the attempt fails, this parameter will contain lists of existing bookings which have conflicts with the schedule request. Time and resources are considered here to determine whether conflicts exist.
Get the expected starting time for next scheduled booking with matching category.
Parameters:
-
Name Type Description categoryExpressionstring The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.
Returns:
-
Type: ToiSchedulerService.ToiTime
The expected starting time of next scheduled booking. If a booking is currently ongoing, 0 will be returned.
Get user defined parameters associated with a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
namestring The name of the parameter.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Returns:
-
Type: string
The value of the parameter.
Get all user defined parameters names of a booking
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Returns:
-
Type: Array.<string>
A sequence with names of the parameters.
Get the info of the series with a certain series identifier
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The series identifier to find information about.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the series can not be found.
Returns:
-
Type: ToiSchedulerService.ToiSeries
The info of the scheduled series
Detect conflicts for a new series booking or a series booking about to be rescheduled, but without actually booking any activities.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the series which need to be tested (in case of a rescheduling to be performed) or ToiSchedulerService.SERIES_ID_NONE (in case of a new scheduling to be performed).
categorystring The category info for the attempted series.
activitystring The activity type for the attempted series.
startToiSchedulerService.ToiTime The start time for the attempted series. Seconds since the Unix epoch.
durationnumber The duration time in seconds for each occurrence in the attempted series.
weekdaysnumber Weekday mask indicating which days the series shall happen.
occurrencenumber The number occurrences to be tested. Must be greater than zero.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the series can not be found.
Returns:
-
Type: Array.<ToiSchedulerService.ToiSolution>
If the attempt fails, this parameter will contain lists of existing bookings which have conflicts with the schedule request. Time and resources are considered here to determine whether conflicts exist.
Get the all series identifiers with the given category.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description categoryExpressionstring The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.
Returns:
-
Type: Array.<ToiSchedulerService.ToiSeriesId>
The sequence of series identifiers found.
Get user defined parameters associated with a series.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the series.
namestring The name of the parameter.
Throws:
-
ToiInvalidArgumentException Raised if the series does not exist.
Returns:
-
Type: string
The value of the parameter.
Get all user defined parameters names associated with a series.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the series.
Throws:
-
ToiInvalidArgumentException Raised if the series does not exist.
Returns:
-
Type: Array.<string>
A sequence of names of the parameters.
Get triggers associated with a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Returns:
-
Type: Array.<ToiSchedulerService.ToiDelta>
Sequences of trigger delta times associated with the booking.
Remove a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The identifier of the booking to be removed.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the booking identifier does not exist.
This method removes an event listener for a specific event.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to remove the listener from.
listenerToiEventListener The JavaScript function that was previously added as an event listener.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.
Remove a booked recurrent scheduling.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the recurrent series to be removed.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the series identifier does not exist.
Remove trigger from a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
deltaToiSchedulerService.ToiDelta The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Remove triggers from a number of bookings. If there is no trigger with the specified delta - nothing will be changed for that booking.
Parameters:
-
Name Type Description idsArray.<ToiSchedulerService.ToiBookingId> A sequence of booking identifiers that should remove the trigger.
deltaToiSchedulerService.ToiDelta The delta time in seconds since start point of an booking.
Throws:
-
ToiInvalidArgumentException Raised if one or more bookings can not be found.
Requests changing and rescheduling of a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The identifier of the booking which needs to be rescheduled.
categorystring The new category info for the booking.
activitystring The new activity type for the booking.
startToiSchedulerService.ToiTime The start time for the booking. Seconds since the Unix epoch.
durationnumber The duration time in seconds for the booking.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the booking identifier does not exist, if changing to a time in the past, or if the new activity used other resources.
ToiNotEnoughResourcesException The exception will be thrown if the reschedule request fails due to resource conflict.
Requests scheduling of a new booking.
Parameters:
-
Name Type Description categorystring The category info for the booking.
activitystring The activity type for the booking.
startToiSchedulerService.ToiTime The start time for the booking. Seconds since the Unix epoch.
durationnumber The duration time in seconds for the booking.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the activity type does not exist or if start or time is in the past.
ToiNotEnoughResourcesException The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system.
Returns:
-
Type: ToiSchedulerService.ToiBookingId
A generated booking identifier that will be used in further communication with the client. If the request fails due to conflicts with other bookings this value will be set to ToiSchedulerService.BOOKING_ID_NONE.
Requests scheduling of a recurrent booking.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description categorystring The category info for the series.
activitystring The activity type for the series.
startToiSchedulerService.ToiTime The start time for the first occurrence of the series. Seconds since the Unix epoch.
durationnumber The duration time in seconds for each occurrence of the series.
weekdaysnumber Weekday mask indicating which days the recurring series shall happen.
numberOfOccurrencesnumber The number of occurrences for the series.
conflictStrategyToiSchedulerService.ToiConflictStrategy The type of conflict handling strategy to use if a conflict with previously scheduled bookings is detected.
Throws:
-
ToiInvalidArgumentException The exception will be thrown if the activity type does not exist or if start or time is in the past.
ToiNotEnoughResourcesException The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system.
Returns:
-
Type: ToiSchedulerService.ToiSeriesId
A generated series identifier that will be used in further communication with the client. If the request fails due to conflicts with other bookings this value will be set to ToiSchedulerService.SERIES_ID_NONE.
This method is used to filter which categories the application is notified about.
Parameters:
-
Name Type Description eventListenerToiEventListener The eventListener that has been registered.
categoryExpressionstring The category expression of the bookings to be notified about. Wildcard "" is supported when it is at the beginning or end of a string. And a single "" match all category. Supported wildcard is like that "dvr", "dvr", "*". Otherwise it is treated as an ordinary character.
Throws:
-
ToiInvalidArgumentException Raised if the observer/listener is unknown.
Add user defined parameters to a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
namestring The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten.
valuestring The value of the parameter to set.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Add user defined parameters to a set of bookings.
Parameters:
-
Name Type Description idsArray.<ToiSchedulerService.ToiBookingId> A sequence of booking identifiers to update with parameters.
namesArray.<string> A sequence of parameter names to be set. Existing parameters with matching names will be overwritten.
valuesArray.<string> A sequence of parameter values to be set, matching the parameter names.
Throws:
-
ToiInvalidArgumentException Raised if any of the bookings do not exist.
Add user defined parameters to a scheduled series.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the series.
namestring The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten.
valuestring The value of the parameter to set.
Throws:
-
ToiInvalidArgumentException Raised if the series does not exist.
Remove user defined parameters from a booking.
Parameters:
-
Name Type Description idToiSchedulerService.ToiBookingId The booking identifier.
namestring The name of the parameter to remove.
Throws:
-
ToiInvalidArgumentException Raised if the booking does not exist.
Remove user defined parameters from a scheduled series.
Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
Parameters:
-
Name Type Description idToiSchedulerService.ToiSeriesId The identifier of the series.
namestring The name of the parameter to remove.
Throws:
-
ToiInvalidArgumentException Raised if the series does not exist.
Members
This is an Event identifier for ToiSchedulerBookingsAddedEvent.
This function will be called when one or several bookings are created.
This is an Event identifier for ToiSchedulerBookingsChangedEvent.
This function will be called when one or several bookings are changed.
This is an Event identifier for ToiSchedulerBookingsRemovedEvent.
This function will be called when one or several bookings are removed.
This is an Event identifier for ToiSchedulerScheduledDiscontinuityEvent.
This function will be called in the rare condition when there has been a discontinuity in time and any notification timestamp (start, stop or trigger) of a booking has already expired (after adjusting time). The expired notifications will be missed and any remaining notifications will be sent as normal at the correct time.
This is an Event identifier for ToiSchedulerScheduledStartEvent.
This function will be called when the start timestamp of a booking is reached. If an application starts observing the booking after start timestamp has passed, it will receive no such callback.
This is an Event identifier for ToiSchedulerScheduledStopEvent.
This function will be called when the stop timestamp of a booking is reached.
This is an Event identifier for ToiSchedulerScheduledTriggerEvent.
This function will be called when the delta timestamp before or after the start of a booking is reached.
This is an Event identifier for ToiSchedulerSeriesChangedEvent.
This function will be called when a series is changed.
When schedule failed, the application may call ToiSchedulerService#getConflicts with a booking identifier of ToiSchedulerService.BOOKING_ID_NONE to get a list of suggested solutions.
Scheduling will fail without scheduling any bookings when conflicts are detected.
Scheduling will proceed to book only those bookings that are not in conflict.
Indicates that there is no recurrent booking associated.
There is no solution.
The solution is to remove conflicts.
Indicates that the requested scheduled time is the current time (now).
Structure containing information about an existing booking
Struct fields
| Name | Description |
|---|---|
| activityType | The activity type. Type: string |
| category | The category the booking belongs to. Type: string |
| duration | The duration. A value < 0 means no OnScheduledStop will be sent Type: number |
| id | Booking identifier. Type: ToiSchedulerService.ToiBookingId |
| seriesId | If the booking is part of a series, the parameter refers to the identifier of the series, otherwise set to ToiSchedulerService.SERIES_ID_NONE. Type: ToiSchedulerService.ToiSeriesId |
| start | The start time. Type: ToiSchedulerService.ToiTime |
Structure containing information about an existing series
Technical Preview:
Struct fields
| Name | Description |
|---|---|
| activityType | The activity type. Type: string |
| category | The category the series belongs to. Type: string |
| duration | The duration. A value < 0 means no OnScheduledStop will be sent Type: number |
| id | Series identifier. Type: ToiSchedulerService.ToiSeriesId |
| originalNumberOfOccurrences | The number of occurrences originally scheduled for this recurrent booking. If some occurrences have been removed, the value might not reflect the actual number of bookings connected to this recurrent booking. Note: |
| start | The start time of the series. Type: ToiSchedulerService.ToiTime |
| weekdays | Bit mask indicating which days a recurring booking shall happen. Type: number |
Conflict solution struct
Struct fields
| Name | Description |
|---|---|
| affectedBookings | The bookings that need to be resolved according to solution type, i.e. removed if the solution type is ToiSchedulerService.SOLUTION_TYPE_REMOVE. Type: Array.<ToiSchedulerService.ToiBookingId> |
| type | The solution type. Type: ToiSchedulerService.ToiSolutionType |