Interface AppointmentBatchAdminSession
- All Superinterfaces:
AppointmentAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Appointments 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 an
Appointment , an AppointmentForm is requested using
getAppointmentFormsForCreate() specifying the desired position, person,
record Types or none if no record Types are needed. Each
of the returned AppointmentForms 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 an AppointmentForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
AppointmentForm corresponds to an attempted transaction.
The AppointmentForms returned from
getAppointmentFormsForCreate() may be linked to the originating request
through the peer Ids of the AppointmentForm . In the case
where there may be duplicates, any AppointmentForm of the same
peer Ids may be used for a create operation.
Once a batch of AppointmentForms are submitted for create, a
CreateResponse is returned for each AppointmentForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createAppointments() ,
errors specific to an individual AppointmentForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating AppointmentForm through the
AppointmentForm Id .
For updates, AppointmentForms are requested to the
Appointment Id that is to be updated using
getAppointmentFormsForUpdate() where the reference Id in the
AppointmentForm may be used to link the request. Similarly, the
AppointmentForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
AppointmentForm can only be used once for a successful update and cannot
be reused.
Once a batch of AppointmentForms are submitted for update, an
UpdateResponse is returned for each AppointmentForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateAppointments() ,
errors specific to an individual AppointmentForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating AppointmentForm through the
AppointmentForm Id .
The delete operations delete Appointments in bulk. To unmap an
Appointment from the current Realm , the
AppointmentRealmAssignmentSession should be used. These delete operations
attempt to remove the Appointment itself thus removing it from all
known Realm catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAppointments(AliasRequestList aliasRequests) Adds anIdto anAppointmentfor the purpose of creating compatibility.createAppointments(AppointmentBatchFormList appointmentForms) Creates a new set ofAppointments.Deletes allAppointmentsin thisRealm.deleteAppointments(IdList appointmentIds) Deletes appointments for the givenIds.deleteAppointmentsForPerson(Id personId) Deletes appointments for the given person.deleteAppointmentsForPosition(Id positionId) Deletes appointments for the given position.Deletes appointments expired before the given date.getAppointmentFormsForCreate(AppointmentPeerList peers, Type[] appointmentRecordTypes) Gets the appointment forms for creating a bunch of new appointments.getAppointmentFormsForUpdate(IdList appointmentIds) Gets the appointment forms for updating an existing set of appointments.updateAppointments(AppointmentBatchFormList appointmentForms) Updates existing appointments.Methods inherited from interface AppointmentAdminSession
aliasAppointment, canCreateAppointments, canCreateAppointmentWithRecordTypes, canDeleteAppointments, canManageAppointmentAliases, canUpdateAppointments, createAppointment, deleteAppointment, getAppointmentFormForCreate, getAppointmentFormForUpdate, getRealm, getRealmId, updateAppointmentModifier and TypeMethodDescriptionvoidaliasAppointment(Id appointmentId, Id aliasId) Adds anIdto anAppointmentfor the purpose of creating compatibility.booleanTests if this user can create appointments.booleancanCreateAppointmentWithRecordTypes(Type[] appointmentRecordTypes) Tests if this user can create a singleAppointmentusing the desired record types.booleanTests if this user can delete appointments.booleanTests if this user can manageIdaliases forAppointments.booleanTests if this user can update appointments.createAppointment(AppointmentForm appointmentForm) Creates a newAppointment.voiddeleteAppointment(Id appointmentId) Deletes anAppointment.getAppointmentFormForCreate(Id personId, Id positionId, Type[] appointmentRecordTypes) Gets the appointment form for creating new appointments.getAppointmentFormForUpdate(Id appointmentId) Gets the appointment form for updating an existing appointment.getRealm()Gets theRealmassociated with this session.Gets theRealmIdassociated with this session.voidupdateAppointment(AppointmentForm appointmentForm) Updates an existing appointment.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.
-
Method Details
-
getAppointmentFormsForCreate
AppointmentBatchFormList getAppointmentFormsForCreate(AppointmentPeerList peers, Type[] appointmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the appointment forms for creating a bunch of new appointments. A form is returned for each supplied position and resource pair.- Parameters:
peers- the relationship peersappointmentRecordTypes- array of appointment record types to be included in each create operation or an empty list if none- Returns:
- the appointment forms
- Throws:
NotFoundException- apersonIdorpositionIdis not foundNullArgumentException-peersorappointmentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAppointments
CreateResponseList createAppointments(AppointmentBatchFormList appointmentForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAppointments. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
appointmentForms- the appointment forms- Returns:
- the create responses
- Throws:
NullArgumentException-appointmentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAppointmentFormsForUpdate
AppointmentBatchFormList getAppointmentFormsForUpdate(IdList appointmentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the appointment forms for updating an existing set of appointments. A new appointment form should be requested for each update transaction.- Parameters:
appointmentIds- theIdsof theAppointment- Returns:
- the appointment form
- Throws:
NotFoundException- anappointmentIdis not foundNullArgumentException-appointmentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAppointments
UpdateResponseList updateAppointments(AppointmentBatchFormList appointmentForms) throws OperationFailedException, PermissionDeniedException Updates existing appointments. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
appointmentForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-appointmentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAppointments
DeleteResponseList deleteAllAppointments() throws OperationFailedException, PermissionDeniedExceptionDeletes allAppointmentsin thisRealm.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAppointments
DeleteResponseList deleteAppointments(IdList appointmentIds) throws OperationFailedException, PermissionDeniedException Deletes appointments for the givenIds.- Parameters:
appointmentIds- theIdsof the appointments to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-appointmentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAppointmentsForPerson
DeleteResponseList deleteAppointmentsForPerson(Id personId) throws OperationFailedException, PermissionDeniedException Deletes appointments for the given person.- Parameters:
personId- anIdof a person- Returns:
- the delete responses
- Throws:
NullArgumentException-personIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAppointmentsForPosition
DeleteResponseList deleteAppointmentsForPosition(Id positionId) throws OperationFailedException, PermissionDeniedException Deletes appointments for the given position.- Parameters:
positionId- anIdof a position- Returns:
- the delete responses
- Throws:
NullArgumentException-positionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveAppointmentsByDate
DeleteResponseList deleteIneffectiveAppointmentsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes appointments expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAppointments
AliasResponseList aliasAppointments(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAppointmentfor the purpose of creating compatibility. The primaryIdof theAppointmentis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another appointment, it is reassigned to the given appointmentId.- 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.
-