Interface ScheduleBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ScheduleAdminSession
This session creates, updates, and deletes Schedules in bulk.
The data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
Schedule , a ScheduleForm is requested using
getScheduleFormsForCreate() specifying the desired schedule slot, time
period, record Types or none if no record Types are
needed. Each of the returned ScheduleForms will indicate that it
is to be used with a create operation and can be used to examine metdata
or validate data prior to creation. Once a ScheduleForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ScheduleForm corresponds to an attempted transaction.
The ScheduleForms returned from
getScheduleFormsForCreate() may be linked to the originating request
through the peer Ids of the ScheduleForm . In the case
where there may be duplicates, any ScheduleForm of the same peer
Ids may be used for a create operation.
Once a batch of ScheduleForms are submitted for create, a
CreateResponse is returned for each ScheduleForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createSchedules() ,
errors specific to an individual ScheduleForm are indicated in the
corresponding CreateResponse . CreateResponses may be
linked to the originating ScheduleForm through the
ScheduleForm Id .
For updates, ScheduleForms are requested to the
Schedule Id that is to be updated using
getScheduleFormsForUpdate() where the reference Id in the
ScheduleForm may be used to link the request. Similarly, the
ScheduleForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The ScheduleForm
can only be used once for a successful update and cannot be reused.
Once a batch of ScheduleForms are submitted for update, an
UpdateResponse is returned for each ScheduleForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateSchedules() ,
errors specific to an individual ScheduleForm are indicated in the
corresponding UpdateResponse . UpdateResponses may be
linked to the originating ScheduleForm through the
ScheduleForm Id .
The delete operations delete Schedules in bulk. To unmap a
Schedule from the current Calendar , the
ScheduleCalendarAssignmentSession should be used. These delete operations
attempt to remove the Schedule itself thus removing it from all
known Calendar catalogs. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasSchedules(AliasRequestList aliasRequests) Adds anIdto aSchedulefor the purpose of creating compatibility.createSchedules(ScheduleBatchFormList scheduleForms) Creates a new set ofSchedules.Deletes allSchedulesin thisCalendar.deleteSchedules(IdList scheduleIds) Deletes schedules for the givenIds.deleteSchedulesForScheduleSlot(Id scheduleSlotId) Deletes schedules for the given schedule slot.deleteSchedulesForTimePeriod(Id timePeriodId) Deletes schedules for the given time period.getScheduleFormsForCreate(SchedulePeerList peers, Type[] scheduleRecordTypes) Gets the schedule forms for creating a bunch of new schedules.getScheduleFormsForUpdate(IdList scheduleIds) Gets the schedule forms for updating an existing set of schedules.updateSchedules(ScheduleBatchFormList scheduleForms) Updates existing schedules.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.Methods inherited from interface ScheduleAdminSession
aliasSchedule, canCreateSchedules, canCreateScheduleWithRecordTypes, canDeleteSchedules, canManageScheduleAliases, canUpdateSchedules, createSchedule, deleteSchedule, getCalendar, getCalendarId, getScheduleFormForCreate, getScheduleFormForUpdate, updateScheduleModifier and TypeMethodDescriptionvoidaliasSchedule(Id scheduleId, Id aliasId) Adds anIdto aSchedulefor the purpose of creating compatibility.booleanTests if this user can createSchedules.booleancanCreateScheduleWithRecordTypes(Type[] scheduleRecordTypes) Tests if this user can create a singleScheduleusing the desired record types.booleanTests if this user can deleteSchedules.booleanTests if this user can manageIdaliases forSchedules.booleanTests if this user can updateSchedules.createSchedule(ScheduleForm scheduleForm) Creates a newSchedule.voiddeleteSchedule(Id scheduleId) Deletes theScheduleidentified by the givenId.Gets theCalendarassociated with this session.Gets theCalendarIdassociated with this session.getScheduleFormForCreate(Type[] scheduleRecordTypes) Gets the schedule form for creating new schedules.getScheduleFormForUpdate(Id scheduleId) Gets the schedule form for updating an existing schedules.voidupdateSchedule(ScheduleForm scheduleForm) Updates an existing schedule.
-
Method Details
-
getScheduleFormsForCreate
ScheduleBatchFormList getScheduleFormsForCreate(SchedulePeerList peers, Type[] scheduleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the schedule forms for creating a bunch of new schedules. A form is returned for each supplied schedule slot and time period pair.- Parameters:
peers- the schedule peersscheduleRecordTypes- array of schedule record types to be included in each create operation or an empty list if none- Returns:
- the schedule forms
- Throws:
NotFoundException- ascheduleSlotIdortimePeriodIdis not foundNullArgumentException-peersorscheduleRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createSchedules
CreateResponseList createSchedules(ScheduleBatchFormList scheduleForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofSchedules. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
scheduleForms- the schedule forms- Returns:
- the create responses
- Throws:
NullArgumentException-scheduleFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getScheduleFormsForUpdate
ScheduleBatchFormList getScheduleFormsForUpdate(IdList scheduleIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the schedule forms for updating an existing set of schedules. A new schedule form should be requested for each update transaction.- Parameters:
scheduleIds- theIdsof theSchedule- Returns:
- the schedule form
- Throws:
NotFoundException- ascheduleIdis not foundNullArgumentException-scheduleIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSchedules
UpdateResponseList updateSchedules(ScheduleBatchFormList scheduleForms) throws OperationFailedException, PermissionDeniedException Updates existing schedules. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
scheduleForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-scheduleFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllSchedules
Deletes allSchedulesin thisCalendar.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSchedules
DeleteResponseList deleteSchedules(IdList scheduleIds) throws OperationFailedException, PermissionDeniedException Deletes schedules for the givenIds.- Parameters:
scheduleIds- theIdsof the schedules to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-scheduleIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSchedulesForScheduleSlot
DeleteResponseList deleteSchedulesForScheduleSlot(Id scheduleSlotId) throws OperationFailedException, PermissionDeniedException Deletes schedules for the given schedule slot.- Parameters:
scheduleSlotId- anIdof a schedule slot- Returns:
- the delete responses
- Throws:
NullArgumentException-scheduleSlotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSchedulesForTimePeriod
DeleteResponseList deleteSchedulesForTimePeriod(Id timePeriodId) throws OperationFailedException, PermissionDeniedException Deletes schedules for the given time period.- Parameters:
timePeriodId- anIdof a time period- Returns:
- the delete responses
- Throws:
NullArgumentException-timePeriodIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasSchedules
AliasResponseList aliasSchedules(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aSchedulefor the purpose of creating compatibility. The primaryIdof theScheduleis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another schedule, it is reassigned to the given scheduleId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-