Interface ObjectiveBankAdminSession

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

public interface ObjectiveBankAdminSession extends OsidSession

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

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

The delete operations delete ObjectiveBanks . It is safer to remove all mappings to the ObjectiveBank catalogs before deletion.

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

  • Method Details

    • canCreateObjectiveBanks

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

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

      ObjectiveBankForm getObjectiveBankFormForCreate(Type[] objectiveBankRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the objective bank form for creating new objective banks. A new form should be requested for each create transaction.
      Parameters:
      objectiveBankRecordTypes - array of objective bank record types
      Returns:
      the objective bank form
      Throws:
      NullArgumentException - objectiveBankRecordTypes 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.
    • createObjectiveBank

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

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

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

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

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

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

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

      void aliasObjectiveBank(Id objectiveBankId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to an ObjectiveBank for the purpose of creating compatibility. The primary Id of the ObjectiveBank 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 bank, it is reassigned to the given objective bank Id .
      Parameters:
      objectiveBankId - the Id of an ObjectiveBank
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - objectiveBankId not found
      NullArgumentException - objectiveBankId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.