Interface EnrollmentAdminSession

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

public interface EnrollmentAdminSession extends OsidSession

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

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

The delete operations delete Enrollments . To unmap an EnrollmentForm from the current CourseCatalog , the EnrollmentCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the EnrollmentForm itself thus removing it from all known CourseCatalog catalogs.

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

  • Method Details

    • getCourseCatalogId

      Id getCourseCatalogId()
      Gets the CourseCatalog Id associated with this session.
      Returns:
      the CourseCatalog Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCourseCatalog

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

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

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

      EnrollmentForm getEnrollmentFormForCreate(Id programOfferingId, Id resourceId, Type[] enrollmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the course form for creating new enrollments. A new form should be requested for each create transaction.
      Parameters:
      programOfferingId - the Id for a ProgramOffering
      resourceId - the Id for a Resource
      enrollmentRecordTypes - array of enrollment record types
      Returns:
      the enrollment form
      Throws:
      NotFoundException - programOfferingId , or resourceId is not found
      NullArgumentException - programOfferingId, resourceId , or enrollmentRecordTypes 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.
    • createEnrollment

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

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

      EnrollmentForm getEnrollmentFormForUpdate(Id enrollmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the enrollment form for updating an existing enrollment. A new enrollment form should be requested for each update transaction.
      Parameters:
      enrollmentId - the Id of the Enrollment
      Returns:
      the enrollment form
      Throws:
      NotFoundException - enrollmentId is not found
      NullArgumentException - enrollmentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateEnrollment

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

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

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

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

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