Interface ScheduleAdminSession

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

public interface ScheduleAdminSession extends OsidSession

This session creates, updates, and deletes Schedules . 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 getScheduleFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned ScheduleForm 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 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.

For updates, ScheduleForms are requested to the Schedule Id that is to be updated using getScheduleFormForUpdate() . 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.

The delete operations delete Schedules . To unmap a Schedule from the current Calendar , the ScheduleSCalendarAssignmentSession should be used. These delete operations attempt to remove the Schedule itself thus removing it from all known Calendar catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getCalendarId

      Id getCalendarId()
      Gets the Calendar Id associated with this session.
      Returns:
      the Calendar Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCalendar

      Gets the Calendar associated with this session.
      Returns:
      the Calendar associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateSchedules

      boolean canCreateSchedules()
      Tests if this user can create Schedules . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Schedule will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if Schedule creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateScheduleWithRecordTypes

      boolean canCreateScheduleWithRecordTypes(Type[] scheduleRecordTypes)
      Tests if this user can create a single Schedule using the desired record types. While CalendaringManager.getScheduleRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Schedule . Providing an empty array tests if a Schedule can be created with no records.
      Parameters:
      scheduleRecordTypes - array of schedule record types
      Returns:
      true if Schedule creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - scheduleRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getScheduleFormForCreate

      ScheduleForm getScheduleFormForCreate(Type[] scheduleRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the schedule form for creating new schedules. A new form should be requested for each create transaction.
      Parameters:
      scheduleRecordTypes - array of schedule record types
      Returns:
      the schedule form
      Throws:
      NullArgumentException - scheduleRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createSchedule

      Creates a new Schedule .
      Parameters:
      scheduleForm - the form for this Schedule
      Returns:
      the new Schedule
      Throws:
      IllegalStateException - scheduleForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - scheduleForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - scheduleForm did not originate from getScheduleFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateSchedules

      boolean canUpdateSchedules()
      Tests if this user can update Schedules . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Schedule will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if schedule modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getScheduleFormForUpdate

      Gets the schedule form for updating an existing schedules. A new schedule form should be requested for each update transaction.
      Parameters:
      scheduleId - the Id of the Schedule
      Returns:
      the schedule form
      Throws:
      NotFoundException - scheduleId is not found
      NullArgumentException - scheduleId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateSchedule

      void updateSchedule(ScheduleForm scheduleForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing schedule.
      Parameters:
      scheduleForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - scheduleForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - scheduleForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - scheduleForm did not originate from getScheduleFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteSchedules

      boolean canDeleteSchedules()
      Tests if this user can delete Schedules . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Schedule will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if Schedule deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteSchedule

      void deleteSchedule(Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes the Schedule identified by the given Id .
      Parameters:
      scheduleId - the Id of the Schedule to delete
      Throws:
      NotFoundException - a Schedule was not found identified by the given Id
      NullArgumentException - scheduleId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageScheduleAliases

      boolean canManageScheduleAliases()
      Tests if this user can manage Id aliases for Schedules . 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 Schedule aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasSchedule

      Adds an Id to a Schedule for the purpose of creating compatibility. The primary Id of the Schedule is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another schedule, it is reassigned to the given schedule Id .
      Parameters:
      scheduleId - the Id of a Schedule
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - scheduleId not found
      NullArgumentException - scheduleId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.