Interface AssessmentAdminSession

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

public interface AssessmentAdminSession extends OsidSession

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

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

The delete operations delete Assessments . To unmap an Assessment from the current Bank , the AssessmentBankAssignmentSession should be used. These delete operations attempt to remove the Assessment 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.
    • canCreateAssessments

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

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

      AssessmentForm getAssessmentFormForCreate(Type[] assessmentRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the assessment form for creating new assessments. A new form should be requested for each create transaction.
      Parameters:
      assessmentRecordTypes - array of assessment record types to be included in the create operation or an empty list if none
      Returns:
      the assessment form
      Throws:
      NullArgumentException - assessmentRecordTypes 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.
    • createAssessment

      Creates a new Assessment .
      Parameters:
      assessmentForm - the form for this Assessment
      Returns:
      the new Assessment
      Throws:
      IllegalStateException - assessmentForm 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.
    • canUpdateAssessments

      boolean canUpdateAssessments()
      Tests if this user can update Assessments . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Assessment 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.
    • getAssessmentFormForUpdate

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

      void updateAssessment(AssessmentForm assessmentForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing assessment.
      Parameters:
      assessmentForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - assessmentForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - assessmentForm 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.
    • canDeleteAssessments

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

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

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

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