public interface AppointmentAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasAppointment(Id appointmentId,
Id aliasId)
Adds an
Id to an Appointment for the
purpose of creating compatibility. |
boolean |
canCreateAppointments()
Tests if this user can create appointments.
|
boolean |
canCreateAppointmentWithRecordTypes(Type[] appointmentRecordTypes)
Tests if this user can create a single
Appointment
using the desired record types. |
boolean |
canDeleteAppointments()
Tests if this user can delete appointments.
|
boolean |
canManageAppointmentAliases()
Tests if this user can manage
Id aliases for
Appointments. |
boolean |
canUpdateAppointments()
Tests if this user can update appointments.
|
Appointment |
createAppointment(AppointmentForm appointmentForm)
Creates a new
Appointment. |
void |
deleteAppointment(Id appointmentId)
Deletes an
Appointment. |
AppointmentForm |
getAppointmentFormForCreate(Id personId,
Id positionId,
Type[] appointmentRecordTypes)
Gets the appointment form for creating new appointments.
|
AppointmentForm |
getAppointmentFormForUpdate(Id appointmentId)
Gets the appointment form for updating an existing appointment.
|
Realm |
getRealm()
Gets the
Realm associated with this session. |
Id |
getRealmId()
Gets the
Realm Id associated with this
session. |
void |
updateAppointment(AppointmentForm appointmentForm)
Updates an existing appointment.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getRealmId()
Realm Id associated with this
session. Realm Id associated with this sessionmandatory - This method must be implemented. Realm getRealm() throws OperationFailedException, PermissionDeniedException
Realm associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateAppointments()
Appointment will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer create operations to
unauthorized users. false if Appointment creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAppointmentWithRecordTypes(Type[] appointmentRecordTypes)
Appointment
using the desired record types. While
PersonnelManager.getAppointmentRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Appointment.
Providing an empty array tests if an Appointment can be
created with no records.appointmentRecordTypes - array of appointment record types true if Appointment creation
using the specified record Types is supported,
false otherwiseNullArgumentException - appointmentRecordTypes
is null mandatory - This method must be implemented. AppointmentForm getAppointmentFormForCreate(Id personId, Id positionId, Type[] appointmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
personId - the person Id positionId - the position Id appointmentRecordTypes - array of appointment record types to be
included in the create operation or an empty list if noneNotFoundException - personId or
positionId is not foundNullArgumentException - personId, positionId,
or appointmentRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - cannot get form for requested
record typesmandatory - This method must be implemented. Appointment createAppointment(AppointmentForm appointmentForm) throws OperationFailedException, PermissionDeniedException
Appointment. appointmentForm - the form for this Appointment Appointment IllegalStateException - appointmentForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - appointmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - appointmentForm
did not originate from getAppointmentFormForCreate()
mandatory - This method must be implemented. boolean canUpdateAppointments()
Appointment will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer update operations to
unauthorized users. false if Appointment
modification is not authorized, true otherwisemandatory - This method must be implemented. AppointmentForm getAppointmentFormForUpdate(Id appointmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
appointmentId - the Id of the Appointment
NotFoundException - appointmentId is not
foundNullArgumentException - appointmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateAppointment(AppointmentForm appointmentForm) throws OperationFailedException, PermissionDeniedException
appointmentForm - the form containing the elements to be updatedIllegalStateException - appointmentForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - appointmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - appointmentForm
did not originate from getAppointmentFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteAppointments()
Appointment will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false if Appointment deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteAppointment(Id appointmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Appointment. appointmentId - the Id of the Appointment
to removeNotFoundException - appointmentId not
foundNullArgumentException - appointmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageAppointmentAliases()
Id aliases for
Appointments. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Appointment aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasAppointment(Id appointmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Appointment for the
purpose of creating compatibility. The primary Id of
the Appointment is determined by the provider. The new
Id is an alias to the primary Id. If the
alias is a pointer to another appointment, it is reassigned to the
given appointment Id. appointmentId - the Id of an Appointment
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - appointmentId not
foundNullArgumentException - appointmentId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.