Interface OffsetEventAdminSession

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

public interface OffsetEventAdminSession extends OsidSession

This session creates, updates, and deletes Offset Events . 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 OffsetEvent , an OffsetEventForm is requested using getOffsetEventFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned OffsetEventForm 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 OffsetEventForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each OffsetEventForm corresponds to an attempted transaction.

For updates, OffsetEventForms are requested to the OffsetEvent Id that is to be updated using getOffsetEventFormForUpdate() . Similarly, the OffsetventForm has metadata about the data that can be updated and it can perform validation before submitting the update. The OffsetEventForm can only be used once for a successful update and cannot be reused.

The delete operations delete Offset Events . To unmap an OffsetEvent from the current Calendar , the OffstEventCalendarAssignmentSession should be used. These delete operations attempt to remove the OffsetEvent 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.
    • canCreateOffsetEvents

      boolean canCreateOffsetEvents()
      Tests if this user can create OffsetEvents . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an OffsetEvent 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 OffsetEvent creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateOffsetEventWithRecordTypes

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

      OffsetEventForm getOffsetEventFormForCreate(Type[] offsetEventRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the offset event form for creating new offset events. A new form should be requested for each create transaction.
      Parameters:
      offsetEventRecordTypes - array of offset event record types
      Returns:
      the offset event form
      Throws:
      NullArgumentException - offsetEventRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested recod types
      Compliance:
      mandatory - This method must be implemented.
    • createOffsetEvent

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

      boolean canUpdateOffsetEvents()
      Tests if this user can update OffsetEvents . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an OffsetEvent 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 offset event modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getOffsetEventFormForUpdate

      OffsetEventForm getOffsetEventFormForUpdate(Id offsetEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the offset event form for updating an existing offset event. A new offset event form should be requested for each update transaction.
      Parameters:
      offsetEventId - the Id of the OffsetEvent
      Returns:
      the offset event form
      Throws:
      NotFoundException - offsetEventId is not found
      NullArgumentException - offsetEventId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateOffsetEvent

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

      boolean canDeleteOffsetEvents()
      Tests if this user can delete OffsetEvents . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an OffsetEvent 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 OffsetEvent deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteOffsetEvent

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

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

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