Interface SequenceRuleBankAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface SequenceRuleBankAssignmentSession extends OsidSession

This session provides methods to re-assign SequenceRule to Bank mappings. a SequenceRule may appear in multiple Bank objects and removing the last reference to a SequenceRule is the equivalent of deleting it. Each Bank may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a SequenceRule to another Bank is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignSequenceRules

      boolean canAssignSequenceRules()
      Tests if this user can alter sequence rule/bank mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignSequenceRulesToBank

      boolean canAssignSequenceRulesToBank(Id bankId)
      Tests if this user can alter sequence rule/bank mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Parameters:
      bankId - the Id of the Bank
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - bankId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBankIds

      IdList getAssignableBankIds(Id bankId) throws OperationFailedException
      Gets a list of bank including and under the given bank node in which any sequence rule can be assigned.
      Parameters:
      bankId - the Id of the Bank
      Returns:
      list of assignable bank Ids
      Throws:
      NullArgumentException - bankId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBankIdsForSequenceRule

      IdList getAssignableBankIdsForSequenceRule(Id bankId, Id sequenceRuleId) throws OperationFailedException
      Gets a list of bank including and under the given bank node in which a specific sequence rule can be assigned.
      Parameters:
      bankId - the Id of the Bank
      sequenceRuleId - the Id of the SequenceRule
      Returns:
      list of assignable bank Ids
      Throws:
      NullArgumentException - bankId or sequenceRuleId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignSequenceRuleToBank

      void assignSequenceRuleToBank(Id sequenceRuleId, Id bankId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing SequenceRule to a Bank .
      Parameters:
      sequenceRuleId - the Id of the SequenceRule
      bankId - the Id of the Bank
      Throws:
      AlreadyExistsException - sequenceRuleId is already assigned to bankId
      NotFoundException - sequenceRuleId or bankId not found
      NullArgumentException - sequenceRuleId or bankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignSequenceRuleFromBank

      void unassignSequenceRuleFromBank(Id sequenceRuleId, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a SequenceRule from a Bank .
      Parameters:
      sequenceRuleId - the Id of the SequenceRule
      bankId - the Id of the Bank
      Throws:
      NotFoundException - sequenceRuleId or bankId not found or sequenceRuleId not assigned to bankId
      NullArgumentException - sequenceRuleId or bankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignSequenceRuleToBank

      void reassignSequenceRuleToBank(Id sequenceRuleId, Id fromBankId, Id toBankId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a SequenceRule from one Bank to another. Mappings to other Banks are unaffected.
      Parameters:
      sequenceRuleId - the Id of the SequenceRule
      fromBankId - the Id of the current Bank
      toBankId - the Id of the destination Bank
      Throws:
      AlreadyExistsException - sequenceRuleId already assigned to toBankId
      NotFoundException - sequenceRuleId, fromBankId , or toBankId not found or sequenceRuleId not mapped to fromBankId
      NullArgumentException - sequenceRuleId, fromBankId , or toBankId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.