Interface ObjectiveAdminSession

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

public interface ObjectiveAdminSession extends OsidSession

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

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

The delete operations delete Objectives . To unmap an Objective from the current ObjectiveBank , the ObjectiveObjectiveBankAssignmentSession should be used. These delete operations attempt to remove the Objective itself thus removing it from all known ObjectiveBank catalogs.

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

  • Method Details

    • getObjectiveBankId

      Id getObjectiveBankId()
      Gets the ObjectiveBank Id associated with this session.
      Returns:
      the ObjectiveBank Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getObjectiveBank

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

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

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

      ObjectiveForm getObjectiveFormForCreate(Type[] objectiveRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the objective form for creating new objectives. A new form should be requested for each create transaction.
      Parameters:
      objectiveRecordTypes - array of objective record types
      Returns:
      the objective form
      Throws:
      NullArgumentException - objectiveRecordTypes 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.
    • createObjective

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

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

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

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

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

      void deleteObjective(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes the Objective identified by the given Id .
      Parameters:
      objectiveId - the Id of the Objective to delete
      Throws:
      NotFoundException - an Objective was not found identified by the given Id
      NullArgumentException - objectiveId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageObjectiveAliases

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

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