Interface AppointmentAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AppointmentBatchAdminSession
This session creates, updates, and deletes Appointments . 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
getAppointmentFormForCreate() specifying the desired relationship peers
and record Types or none if no record Types are needed.
The returned AppointmentForm 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 the AppointmentForm is submitted 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.
For updates, AppointmentForms are requested to the
Appointment Id that is to be updated using
getAppointmentFormForUpdate() . 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.
The delete operations delete Appointments . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getRealmId
Id getRealmId()Gets theRealmIdassociated with this session.- Returns:
- the
Realm Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getRealm
Gets theRealmassociated with this session.- Returns:
- the realm
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAppointments
boolean canCreateAppointments()Tests if this user can create appointments. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAppointmentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifAppointmentcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAppointmentWithRecordTypes
Tests if this user can create a singleAppointmentusing the desired record types. WhilePersonnelManager.getAppointmentRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAppointment. Providing an empty array tests if anAppointmentcan be created with no records.- Parameters:
appointmentRecordTypes- array of appointment record types- Returns:
trueifAppointmentcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-appointmentRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAppointmentFormForCreate
AppointmentForm getAppointmentFormForCreate(Id personId, Id positionId, Type[] appointmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the appointment form for creating new appointments. A new form should be requested for each create transaction.- Parameters:
personId- the personIdpositionId- the positionIdappointmentRecordTypes- array of appointment record types to be included in the create operation or an empty list if none- Returns:
- the appointment form
- Throws:
NotFoundException-personIdorpositionIdis not foundNullArgumentException-personId, positionId, orappointmentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- cannot get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAppointment
Appointment createAppointment(AppointmentForm appointmentForm) throws OperationFailedException, PermissionDeniedException Creates a newAppointment.- Parameters:
appointmentForm- the form for thisAppointment- Returns:
- the new
Appointment - Throws:
IllegalStateException-appointmentFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-appointmentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-appointmentFormdid not originate fromgetAppointmentFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAppointments
boolean canUpdateAppointments()Tests if this user can update appointments. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAppointmentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifAppointmentmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAppointmentFormForUpdate
AppointmentForm getAppointmentFormForUpdate(Id appointmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the appointment form for updating an existing appointment. A new appointment form should be requested for each update transaction.- Parameters:
appointmentId- theIdof theAppointment- Returns:
- the appointment form
- Throws:
NotFoundException-appointmentIdis not foundNullArgumentException-appointmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAppointment
void updateAppointment(AppointmentForm appointmentForm) throws OperationFailedException, PermissionDeniedException Updates an existing appointment.- Parameters:
appointmentForm- the form containing the elements to be updated- Throws:
IllegalStateException-appointmentFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-appointmentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-appointmentFormdid not originate fromgetAppointmentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAppointments
boolean canDeleteAppointments()Tests if this user can delete appointments. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAppointmentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifAppointmentdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAppointment
void deleteAppointment(Id appointmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAppointment.- Parameters:
appointmentId- theIdof theAppointmentto remove- Throws:
NotFoundException-appointmentIdnot foundNullArgumentException-appointmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAppointmentAliases
boolean canManageAppointmentAliases()Tests if this user can manageIdaliases forAppointments. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifAppointmentaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAppointment
void aliasAppointment(Id appointmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, 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:
appointmentId- theIdof anAppointmentaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-appointmentIdnot foundNullArgumentException-appointmentIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-