|
Description
- Service:
- This is a service and can be accessed through toi.schedulerService
The Scheduler Service handles scheduling and conflict management of resources. A configuration file defines the possible activities and how many resources each activity consume. The application refers to these activities by name when a new booking is created to make it possible for the service to ensure there are no resource conflicts.
Resource management is naive, in that it only indicates potential conflicts. The application layer may still over-use the underlying resources in a way that creates a conflict, e.g. by starting more recordings than the network bandwidth, demuxing hardware or disk bandwidth can handle. It is up to the applications to actually indicate all resource usage by doing bookings and resolving the resulting conflicts.
- See also:
- IToiSchedulerObserver
import "ToiSchedulerService.idl";
List of all members.
Public Member Functions |
| TToiBookingId | schedule (in string category, in string activity, in TToiTime start, in long duration) raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException) |
| TToiSeriesId | scheduleSeries (in string category, in string activity, in TToiTime start, in long duration, in long weekdays, in long numberOfOccurrences, in TToiConflictStrategy conflictStrategy) raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException) |
| void | reschedule (in TToiBookingId id, in string category, in string activity, in TToiTime start, in long duration) raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException) |
| void | remove (in TToiBookingId id) raises (TToiInvalidArgumentException) |
| void | removeSeries (in TToiSeriesId id) raises (TToiInvalidArgumentException) |
| TToiConflictSequence | getConflicts (in TToiBookingId id, in string category, in string activity, in TToiTime start, in long duration) raises (TToiInvalidArgumentException) |
| TToiConflictSequence | getSeriesConflicts (in TToiSeriesId id, in string category, in string activity, in TToiTime start, in long duration, in long weekdays, in long occurrence) raises (TToiInvalidArgumentException) |
| TToiTime | getNextStartTime (in string categoryExpression) |
| ToiSchedulerServiceBooking | getBooking (in TToiBookingId id) raises (TToiInvalidArgumentException) |
| ToiSchedulerServiceSeries | getSeries (in TToiSeriesId id) raises (TToiInvalidArgumentException) |
| TToiBookingIdSequence | getBookingIds (in string categoryExpression, in TToiTime start, in TToiTime stop) raises (TToiInvalidArgumentException) |
| TToiSeriesIdSequence | getSeriesIds (in string categoryExpression) |
| TToiBookingIdSequence | getBookingIdsForSeries (in TToiSeriesId seriesId) raises (TToiInvalidArgumentException) |
| void | addTrigger (in TToiBookingId id, in TToiDelta delta) raises (TToiInvalidArgumentException) |
| void | removeTrigger (in TToiBookingId id, in TToiDelta delta) raises (TToiInvalidArgumentException) |
| void | addTriggerOnBookings (in TToiBookingIdSequence ids, in TToiDelta delta) raises (TToiInvalidArgumentException) |
| void | removeTriggerOnBookings (in TToiBookingIdSequence ids, in TToiDelta delta) raises (TToiInvalidArgumentException) |
| TToiDeltaSequence | getTriggers (in TToiBookingId id) raises (TToiInvalidArgumentException) |
| void | setParameter (in TToiBookingId id, in string name, in string value) raises (TToiInvalidArgumentException) |
| void | unsetParameter (in TToiBookingId id, in string name) raises (TToiInvalidArgumentException) |
| string | getParameter (in TToiBookingId id, in string name) raises (TToiInvalidArgumentException) |
| TToiParameterNameSequence | getParameterNames (in TToiBookingId id) raises (TToiInvalidArgumentException) |
| void | setParametersOnBookings (in TToiBookingIdSequence ids, in TToiParameterNameSequence names, in TToiParameterValueSequence values) raises (TToiInvalidArgumentException) |
| void | setSeriesParameter (in TToiSeriesId id, in string name, in string value) raises (TToiInvalidArgumentException) |
| void | unsetSeriesParameter (in TToiSeriesId id, in string name) raises (TToiInvalidArgumentException) |
| string | getSeriesParameter (in TToiSeriesId id, in string name) raises (TToiInvalidArgumentException) |
| TToiParameterNameSequence | getSeriesParameterNames (in TToiSeriesId id) raises (TToiInvalidArgumentException) |
| void | setCategorySubscription (in ToiEventListener eventListener, in string categoryExpression) raises (TToiInvalidArgumentException) |
Public Attributes |
| const TToiBookingId | BOOKING_ID_NONE = 0 |
| const TToiSeriesId | SERIES_ID_NONE = 0 |
| const TToiTime | TIME_NOW = -1 |
| const long | WEEKDAY_MONDAY = 1 |
| const long | WEEKDAY_TUESDAY = 2 |
| const long | WEEKDAY_WEDNESDAY = 4 |
| const long | WEEKDAY_THURSDAY = 8 |
| const long | WEEKDAY_FRIDAY = 16 |
| const long | WEEKDAY_SATURDAY = 32 |
| const long | WEEKDAY_SUNDAY = 64 |
| const long | WEEKDAY_ALL_WEEKDAYS = 127 |
|
| const long | ON_SCHEDULED_START = 2200 |
| const long | ON_SCHEDULED_STOP = 2201 |
| const long | ON_SCHEDULED_TRIGGER = 2202 |
| const long | ON_SCHEDULED_DISCONTINUITY = 2203 |
| const long | ON_BOOKINGS_ADDED = 2204 |
| const long | ON_BOOKINGS_REMOVED = 2205 |
| const long | ON_BOOKINGS_CHANGED = 2206 |
| const long | ON_SERIES_CHANGED = 2207 |
|
| const TToiConflictStrategy | CONFLICT_STRATEGY_FAIL = 0 |
| const TToiConflictStrategy | CONFLICT_STRATEGY_SKIP_BOOKINGS = 1 |
|
| const TToiSolutionType | SOLUTION_TYPE_NONE = 0 |
| const TToiSolutionType | SOLUTION_TYPE_REMOVE = 1 |
Public Types |
| typedef long | TToiBookingId |
| typedef long | TToiSeriesId |
| typedef long | TToiTime |
| typedef long | TToiWeekdayMask |
| typedef sequence< TToiBookingId > | TToiBookingIdSequence |
| typedef sequence< TToiSeriesId > | TToiSeriesIdSequence |
typedef sequence
< ToiSchedulerServiceBooking > | TToiBookingSequence |
| typedef long | TToiConflictStrategy |
| typedef long | TToiSolutionType |
typedef sequence
< ToiSchedulerServiceSolution > | TToiConflictSequence |
| typedef long | TToiDelta |
| typedef sequence< TToiDelta > | TToiDeltaSequence |
| typedef sequence< string > | TToiParameterNameSequence |
| typedef sequence< string > | TToiParameterValueSequence |
Member Typedef Documentation
Identifier for scheduler bookings.
Collection of booking identifiers.
This type is used as a return value when user wants to test if a new schedule request conflicts with old ones. Each entry in the list contains an alternative solution if there are several ways to resolve the conflict, e.g. by removing a different set of 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.
Collection of delta times, which are the time values in seconds since start point of each booking.
Sequence of parameter names.
Sequence of parameter values.
Identifier for a series of bookings.
Collection of series identifiers.
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.
Member Function Documentation
Add triggers to a booking. For information on triggers, refer to the comments in (C++) ToiSchedulerObserver.
- Parameters:
-
| id | The booking identifier. |
| delta | The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur. |
- Exceptions:
-
Add triggers to a number of bookings. If such a trigger is already define for a booking, no new trigger will be added.
- Parameters:
-
| ids | A sequence of booking identifiers that should use the new trigger. |
| delta | The delta time in seconds since start point of a booking. |
- Exceptions:
-
Get information about a booking.
- Parameters:
-
| id | The booking identifier to find information about. |
- Return values:
-
| booking | The booking information. |
- Exceptions:
-
Get the bookings during start and stop time, with the same category.
- Parameters:
-
| categoryExpression | The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService::setCategorySubscription(). |
| start | Start time of the booking in seconds since the Unix epoch. A value of 0 means no limit. |
| stop | End time of the booking in seconds since the Unix epoch. A value of 0 means no limit. |
- Return values:
-
| bookings | The sequence of booking identifiers found. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Get the bookings associated with a series.
- Parameters:
-
| seriesId | The identifier of the series to retrieve bookings for |
- Return values:
-
| bookings | The sequence of booking identifiers found. |
- Exceptions:
-
Detect conflicts without actually createing a booking.
- Parameters:
-
| id | 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). |
| category | The category info for the attempted booking. |
| activity | The activity type for the attempted booking. |
| start | The start time for the attempted booking. Seconds since the Unix epoch. |
| duration | The duration time in seconds for the attempted booking. |
- Return values:
-
| conflicts | 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. |
- Exceptions:
-
| TToiTime ToiSchedulerService::getNextStartTime |
( |
in string |
categoryExpression | ) |
|
Get the expected starting time for next scheduled booking with matching category.
- Parameters:
-
- Return values:
-
| nextStart | 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:
-
| id | The booking identifier. |
| name | The name of the parameter. |
- Return values:
-
| value | The value of the parameter. |
- Exceptions:
-
Get all user defined parameters names of a booking
- Parameters:
-
| id | The booking identifier. |
- Return values:
-
| names | A sequence with names of the parameters. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Get the info of the series with a certain series identifier
- Parameters:
-
| id | The series identifier to find information about. |
- Return values:
-
| series | The info of the scheduled series |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Detect conflicts for a new series booking or a series booking about to be rescheduled, but without actually booking any activities.
- Parameters:
-
| id | 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). |
| category | The category info for the attempted series. |
| activity | The activity type for the attempted series. |
| start | The start time for the attempted series. Seconds since the Unix epoch. |
| duration | The duration time in seconds for each occurence in the attempted series. |
| weekdays | Weekday mask indicating which days the series shall happen. |
| occurrence | The number occurrences to be tested. Must be greater than zero. |
- Return values:
-
| conflicts | 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. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Get the all series identifiers with the given category.
- Parameters:
-
- Return values:
-
| seriesIds | The sequence of series identifiers found. |
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Get user defined parameters associated with a series.
- Parameters:
-
| id | The identifier of the series. |
| name | The name of the parameter. |
- Return values:
-
| value | The value of the parameter. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Get all user defined parameters names associated with a series.
- Parameters:
-
| id | The identifier of the series. |
- Return values:
-
| names | A sequence of names of the parameters. |
- Exceptions:
-
Get triggers associated with a booking.
- Parameters:
-
| id | The booking identifier. |
- Return values:
-
| deltas | Sequences of trigger delta times associated with the booking. |
- Exceptions:
-
Remove a booking.
- Parameters:
-
| id | The identifier of the booking to be removed. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Remove a booked recurrent scheduling.
- Parameters:
-
| id | The identifier of the recurrent series to be removed. |
- Exceptions:
-
Remove trigger from a booking.
- Parameters:
-
| id | The booking identifier. |
| delta | The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur. |
- Exceptions:
-
Remove triggers from a number of bookings. If there is no trigger with the specified delta - nothing will be changed for that booking.
- Parameters:
-
| ids | A sequence of booking identifiers that should remove the trigger. |
| delta | The delta time in seconds since start point of an booking. |
- Exceptions:
-
Requests changing and rescheduling of a booking.
- Parameters:
-
| id | The identifier of the booking which needs to be rescheduled. |
| category | The new category info for the booking. |
| activity | The new activity type for the booking. |
| start | The start time for the booking. Seconds since the Unix epoch. |
| duration | The duration time in seconds for the booking. |
- Exceptions:
-
| TToiInvalidArgumentException | 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. |
| TToiNotEnoughResourcesException | The exception will be thrown if the reschedule request fails due to resource conflict. |
- Note:
- If a booking has been started, and the reschedule function is called, the scheduler does not care about the start time as long as the end time is after current time. The new end time is calculated based on the newly provided start time and duration. When ToiSchedulerService::getBooking() is called after the reschedule of a started booking, the start time is the same as when the booking start event was fired, and only the duration is updated and calculated from the first start time and the new end time.
Requests scheduling of a new booking.
- Parameters:
-
| category | The category info for the booking. |
| activity | The activity type for the booking. |
| start | The start time for the booking. Seconds since the Unix epoch. |
| duration | The duration time in seconds for the booking. |
- Return values:
-
| id | 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. |
- Exceptions:
-
| TToiInvalidArgumentException | The exception will be thrown if the activity type does not exist or if start or time is in the past. |
| TToiNotEnoughResourcesException | The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system. |
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Requests scheduling of a recurrent booking.
- Parameters:
-
| category | The category info for the series. |
| activity | The activity type for the series. |
| start | The start time for the first occurence of the series. Seconds since the Unix epoch. |
| duration | The duration time in seconds for each occurence of the series. |
| weekdays | Weekday mask indicating which days the recurring series shall happen. |
| numberOfOccurrences | The number of occurrences for the series. |
| conflictStrategy | The type of conflict handling strategy to use if a conflict with previously scheduled bookings is detected. |
- Return values:
-
| id | 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. |
- Exceptions:
-
| TToiInvalidArgumentException | The exception will be thrown if the activity type does not exist or if start or time is in the past. |
| TToiNotEnoughResourcesException | The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system. |
This method is used to filter which categories the application is notified about.
- Parameters:
-
| eventListener | ToiEventListener |
| categoryExpression | 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. |
Add user defined parameters to a booking.
- Parameters:
-
| id | The booking identifier. |
| name | The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten. |
| value | The value of the parameter to set. |
- Exceptions:
-
Add user defined parameters to a set of bookings.
- Parameters:
-
| ids | A sequence of booking identifiers to update with parameters. |
| names | A sequence of parameter names to be set. Existing parameters with matching names will be overwritten. |
| values | A sequence of parameter values to be set, matching the parameter names. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Add user defined parameters to a scheduled series.
- Parameters:
-
| id | The identifier of the series. |
| name | The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten. |
| value | The value of the parameter to set. |
- Exceptions:
-
Remove user defined parameters from a booking.
- Parameters:
-
| id | The booking identifier. |
| name | The name of the parameter to remove. |
- Exceptions:
-
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change. Remove user defined parameters from a scheduled series.
- Parameters:
-
| id | The identifier of the series. |
| name | The name of the parameter to remove. |
- Exceptions:
-
Member Data Documentation
Scheduling will fail without scheduling any bookings when conflicts are detected.
This constant can also be accessed from toi.consts.ToiSchedulerService.CONFLICT_STRATEGY_FAIL.
Scheduling will procede to book only those bookings that are not in conflict.
This constant can also be accessed from toi.consts.ToiSchedulerService.CONFLICT_STRATEGY_SKIP_BOOKINGS.
This is an Event identifier for ToiSchedulerBookingsAddedEvent.
This constant can also be accessed from toi.consts.ToiSchedulerService.ON_BOOKINGS_ADDED.
This is an Event identifier for ToiSchedulerScheduledStartEvent.
This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_START.
This is an Event identifier for ToiSchedulerScheduledStopEvent.
This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_STOP.
This is an Event identifier for ToiSchedulerSeriesChangedEvent.
This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SERIES_CHANGED.
Indicates that there is no recurrent booking associated.
This constant can also be accessed from toi.consts.ToiSchedulerService.SERIES_ID_NONE.
There is no solution.
This constant can also be accessed from toi.consts.ToiSchedulerService.SOLUTION_TYPE_NONE.
The solution is to remove conflicts.
This constant can also be accessed from toi.consts.ToiSchedulerService.SOLUTION_TYPE_REMOVE.
Indicates that the requested scheduled time is the current time (now).
This constant can also be accessed from toi.consts.ToiSchedulerService.TIME_NOW.
|