Interface AssessmentOfferedAdminSession

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

public interface AssessmentOfferedAdminSession extends OsidSession

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

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

The delete operations delete AssessmentsOffered . To unmap an AssessmentOffered from the current Bank , the AssessmentOfferedBankAssignmentSession should be used. These delete operations attempt to remove the AssessmentOffered itself thus removing it from all known Bank catalogs.

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

  • Method Details

    • getBankId

      Id getBankId()
      Gets the Bank Id associated with this session.
      Returns:
      the Bank Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBank

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

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

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

      AssessmentOfferedForm getAssessmentOfferedFormForCreate(Id assessmentId, Type[] assessmentOfferedRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment offered form for creating new assessments offered. A new form should be requested for each create transaction.
      Parameters:
      assessmentId - the Id of the related Assessment
      assessmentOfferedRecordTypes - array of assessment offered record types to be included in the create operation or an empty list if none
      Returns:
      the assessment offered form
      Throws:
      NotFoundException - assessmentId is not found
      NullArgumentException - assessmentId or assessmentOfferedRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createAssessmentOffered

      AssessmentOffered createAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) throws OperationFailedException, PermissionDeniedException
      Creates a new AssessmentOffered .
      Parameters:
      assessmentOfferedForm - the form for this AssessmentOffered
      Returns:
      the new AssessmentOffered
      Throws:
      IllegalStateException - assessmentOffreredForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - assessmentForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentForm did not originate from getAssessmentFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateAssessmentsOffered

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

      AssessmentOfferedForm getAssessmentOfferedFormForUpdate(Id assessmentOfferedId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the assessment offered form for updating an existing assessment offered. A new assessment offered form should be requested for each update transaction.
      Parameters:
      assessmentOfferedId - the Id of the AssessmentOffered
      Returns:
      the assessment offered form
      Throws:
      NotFoundException - assessmentOfferedId is not found
      NullArgumentException - assessmentOfferedId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • updateAssessmentOffered

      void updateAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing assessment offered.
      Parameters:
      assessmentOfferedForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - assessmentOffreredForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - assessmentOfferedForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - assessmentForm did not originate from getAssessmentFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteAssessmentsOffered

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

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

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

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