Interface GradeSystemAdminSession

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

public interface GradeSystemAdminSession extends OsidSession

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

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

The delete operations delete GradeSystems To unmap a GradeSystem from the current Gradebook , the GradeSystemGradebookAssignmentSession should be used. These delete operations attempt to remove the GradeSystem itself thus removing it from all known Gradebook catalogs.

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

  • Method Details

    • getGradebookId

      Id getGradebookId()
      Gets the Gradebook Id associated with this session.
      Returns:
      the Gradebook Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getGradebook

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

      boolean canCreateGradeSystems()
      Tests if this user can create GradeSystems . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a GradeSystem will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if GradeSystem creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradeSystemWithRecordTypes

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

      GradeSystemForm getGradeSystemFormForCreate(Type[] gradeSystemRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the grade system form for creating new grade systems. A new form should be requested for each create transaction.
      Parameters:
      gradeSystemRecordTypes - array of grade system types
      Returns:
      the grade system form
      Throws:
      NullArgumentException - gradeSystemRecordTypes 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.
    • createGradeSystem

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

      boolean canUpdateGradeSystems()
      Tests if this user can update GradeSystems . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a GradeSystem will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if GradeSystem modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getGradeSystemFormForUpdate

      GradeSystemForm getGradeSystemFormForUpdate(Id gradeSystemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the grade system form for updating an existing grade system. A new grade system form should be requested for each update transaction.
      Parameters:
      gradeSystemId - the Id of the GradeSystem
      Returns:
      the grade system form
      Throws:
      NotFoundException - gradeSystemId is not found
      NullArgumentException - gradeSystemId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateGradeSystem

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

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

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

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

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

      @Deprecated boolean canCreateGrades(Id gradeSystemId)
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Tests if this user can create Grades for a GradeSystem . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a GradeSystem will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Parameters:
      gradeSystemId - the Id of a GradeSystem
      Returns:
      false if Grade creation is not authorized, true otherwise
      Throws:
      NullArgumentException - gradeSystemId is null
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradeWithRecordTypes

      @Deprecated boolean canCreateGradeWithRecordTypes(Id gradeSystemId, Type[] gradeRecordTypes)
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Tests if this user can create a single Grade using the desired record types. While GradingManager.getGradeRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Grade . Providing an empty array tests if a Grade can be created with no records.
      Parameters:
      gradeSystemId - the Id of a GradeSystem
      gradeRecordTypes - array of grade recod types
      Returns:
      true if Grade creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - gradeSystemId or gradeRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getGradeFormForCreate

      @Deprecated GradeForm getGradeFormForCreate(Id gradeSystemId, Type[] gradeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Gets the grade form for creating new grades. A new form should be requested for each create transaction.
      Parameters:
      gradeSystemId - the Id of a GradeSystem
      gradeRecordTypes - array of grade recod types
      Returns:
      the grade form
      Throws:
      NotFoundException - gradeSystemId is not found
      NullArgumentException - gradeSystemId or gradeRecordTypes 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.
    • createGrade

      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Creates a new Grade .
      Parameters:
      gradeForm - the form for this Grade
      Returns:
      the new Grade
      Throws:
      IllegalStateException - gradeForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - gradeForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradeForm did not originate from getGradeFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateGrades

      @Deprecated boolean canUpdateGrades(Id gradeSystemId)
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Tests if this user can update Grades . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Grade will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Parameters:
      gradeSystemId - the Id of a GradeSystem
      Returns:
      false if Grade modification is not authorized, true otherwise
      Throws:
      NullArgumentException - gradeSystemId is null
      Compliance:
      mandatory - This method must be implemented.
    • getGradeFormForUpdate

      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Gets the grade form for updating an existing grade. A new grade form should be requested for each update transaction.
      Parameters:
      gradeId - the Id of the Grade
      Returns:
      the grade form
      Throws:
      NotFoundException - gradeId is not found
      NullArgumentException - gradeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateGrade

      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Updates an existing grade.
      Parameters:
      gradeForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - gradeForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - gradeId or gradeForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradeForm did not originate from getGradeFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteGrades

      @Deprecated boolean canDeleteGrades(Id gradeSystemId)
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Tests if this user can delete grades. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Grade will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Parameters:
      gradeSystemId - the Id of a GradeSystem
      Returns:
      false if Grade deletion is not authorized, true otherwise
      Throws:
      NullArgumentException - gradeSystemId is null
      Compliance:
      mandatory - This method must be implemented.
    • deleteGrade

      Deletes a Grade .
      Parameters:
      gradeId - the Id of the Grade to remove
      Throws:
      NotFoundException - gradeId not found
      NullArgumentException - gradeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageGradeAliases

      @Deprecated boolean canManageGradeAliases()
      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Tests if this user can manage Id aliases for Grades . 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 Grade aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasGrade

      Deprecated.
      as of 3.0.0rc6. Method moved to GradeAdminSession .
      Adds an Id to a Grade for the purpose of creating compatibility. The primary Id of the Grade is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another grade, it is reassigned to the given grade Id .
      Parameters:
      gradeId - the Id of a Grade
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - gradeId not found
      NullArgumentException - gradeId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.