Interface BankAdminSession

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

public interface BankAdminSession extends OsidSession

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

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

The delete operations delete Banks .

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

  • Method Details

    • canCreateBanks

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

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

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

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

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

      Gets the bank form for updating an existing bank. A new bank form should be requested for each update transaction.
      Parameters:
      bankId - the Id of the Bank
      Returns:
      the bank form
      Throws:
      NotFoundException - bankId is not found
      NullArgumentException - bankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      Compliance:
      mandatory - This method must be implemented.
    • updateBank

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

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

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

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

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