Interface RegistrationTargetAdminSession

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

public interface RegistrationTargetAdminSession extends OsidSession

This session creates, updates, and deletes RegistrationTar gets. 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 RegistrationTa rget, a RegistrationTarge tForm is requested using getRegistrationTargetFormForCre ate() specifying the desired course offering and record Types or none if no record Types are needed. The returned RegistrationTarge tForm 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 RegistrationTarge tForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each RegistrationTarge tForm corresponds to an attempted transaction.

For updates, RegistrationTarget Forms are requested to the RegistrationT arget Id that is to be updated using getRegistrationTargetFormForUpda te(). Similarly, the RegistrationTarge tForm has metadata about the data that can be updated and it can perform validation before submitting the update. The RegistrationTarge tForm can only be used once for a successful update and cannot be reused.

The delete operations delete RegistrationTar gets. To unmap a RegistrationT arget from the current CourseCatalog , the RegistrationTargetCourseCatalogAssignmentSe ssion should be used. These delete operations attempt to remove the RegistrationT arget 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.
    • canCreateRegistrationTargets

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

      boolean canCreateRegistrationTargetWithRecordTypes(Type[] registrationTargetRecordTypes)
      Tests if this user can create a single RegistrationTa rget using the desired record types. While CourseRegistrationManager.getRegistrationTargetRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific RegistrationTa rget. Providing an empty array tests if a RegistrationTar get can be created with no records.
      Parameters:
      registrationTargetRecordTypes - array of registration target record types
      Returns:
      true if RegistrationTarget creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - registrationTargetRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getRegistrationTargetFormForCreate

      RegistrationTargetForm getRegistrationTargetFormForCreate(Id courseOfferingId, Type[] registrationTargetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the registration target form for creating new registration targets. A new form should be requested for each create transaction.
      Parameters:
      courseOfferingId - a course offering Id
      registrationTargetRecordTypes - array of registration target record types
      Returns:
      the registration target form
      Throws:
      NotFoundException - courseOfferingId is not found
      NullArgumentException - courseOfferingId or registrationTargetRecordTypes 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.
    • createRegistrationTarget

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

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

      RegistrationTargetForm getRegistrationTargetFormForUpdate(Id registrationTargetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the registration target form for updating an existing registration target. A new registration target form should be requested for each update transaction.
      Parameters:
      registrationTargetId - the Id of the RegistrationTarget
      Returns:
      the registration target form
      Throws:
      NotFoundException - registrationTargetId is not found
      NullArgumentException - registrationTargetId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateRegistrationTarget

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

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

      void deleteRegistrationTarget(Id registrationTargetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a RegistrationTarget .
      Parameters:
      registrationTargetId - the Id of the RegistrationTarget to remove
      Throws:
      NotFoundException - registrationTargetId not found
      NullArgumentException - registrationTargetId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageRegistrationTargetAliases

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

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