Interface AppointmentAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
AppointmentBatchAdminSession

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.

  • Method Details

    • getRealmId

      Id getRealmId()
      Gets the Realm Id associated with this session.
      Returns:
      the Realm Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRealm

      Gets the Realm associated with this session.
      Returns:
      the realm
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 an 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.
      Returns:
      false if Appointment creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAppointmentWithRecordTypes

      boolean canCreateAppointmentWithRecordTypes(Type[] appointmentRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      appointmentRecordTypes - array of appointment record types
      Returns:
      true if Appointment creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - appointmentRecordTypes is null
      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 person Id
      positionId - the position Id
      appointmentRecordTypes - array of appointment record types to be included in the create operation or an empty list if none
      Returns:
      the appointment form
      Throws:
      NotFoundException - personId or positionId is not found
      NullArgumentException - personId, positionId , or appointmentRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - cannot get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createAppointment

      Creates a new Appointment .
      Parameters:
      appointmentForm - the form for this Appointment
      Returns:
      the new Appointment
      Throws:
      IllegalStateException - appointmentForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - appointmentForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - appointmentForm did not originate from getAppointmentFormForCreate()
      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 an 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.
      Returns:
      false if Appointment modification is not authorized, true otherwise
      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 - the Id of the Appointment
      Returns:
      the appointment form
      Throws:
      NotFoundException - appointmentId is not found
      NullArgumentException - appointmentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - appointmentForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - appointmentForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - appointmentForm did not originate from getAppointmentFormForUpdate()
      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 an 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.
      Returns:
      false if Appointment deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteAppointment

      void deleteAppointment(Id appointmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes an Appointment .
      Parameters:
      appointmentId - the Id of the Appointment to remove
      Throws:
      NotFoundException - appointmentId not found
      NullArgumentException - appointmentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageAppointmentAliases

      boolean canManageAppointmentAliases()
      Tests if this user can manage 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.
      Returns:
      false if Appointment aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasAppointment

      void aliasAppointment(Id appointmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an 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 .
      Parameters:
      appointmentId - the Id of an Appointment
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - appointmentId not found
      NullArgumentException - appointmentId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.