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.
Modifier and Type | Method and Description |
---|---|
void |
aliasBank(Id bankId,
Id aliasId)
Adds an
Id to a Bank for the purpose of
creating compatibility. |
boolean |
canCreateBanks()
Tests if this user can create
Banks. |
boolean |
canCreateBankWithRecordTypes(Type[] bankRecordTypes)
Tests if this user can create a single
Bank using the
desired record types. |
boolean |
canDeleteBanks()
Tests if this user can delete banks.
|
boolean |
canManageBankAliases()
Tests if this user can manage
Id aliases for
Banks. |
boolean |
canUpdateBanks()
Tests if this user can update
Banks. |
Bank |
createBank(BankForm bankForm)
Creates a new
Bank. |
void |
deleteBank(Id bankId)
Deletes a
Bank. |
BankForm |
getBankFormForCreate(Type[] bankRecordTypes)
Gets the bank form for creating new banks.
|
BankForm |
getBankFormForUpdate(Id bankId)
Gets the bank form for updating an existing bank.
|
void |
updateBank(BankForm bankForm)
Updates an existing bank.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateBanks()
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. false
if Bank
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateBankWithRecordTypes(Type[] bankRecordTypes)
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.bankRecordTypes
- array of bank record types true
if Bank
creation using the
specified Types
is supported, false
otherwiseNullArgumentException
- bankRecordTypes
is null
mandatory
- This method must be implemented. BankForm getBankFormForCreate(Type[] bankRecordTypes) throws OperationFailedException, PermissionDeniedException
bankRecordTypes
- array of bank record types to be included in
the create operation or an empty list if noneNullArgumentException
- bankRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Bank createBank(BankForm bankForm) throws OperationFailedException, PermissionDeniedException
Bank.
bankForm
- the form for this Bank
Bank
IllegalStateException
- bankForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- bankForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredUnsupportedException
- bankForm
did not
originate from getBankFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateBanks()
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. false
if Bank
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. BankForm getBankFormForUpdate(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- the Id
of the Bank
NotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. void updateBank(BankForm bankForm) throws OperationFailedException, PermissionDeniedException
bankForm
- the form containing the elements to be updatedIllegalStateException
- bankForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- bankForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredUnsupportedException
- bankForm
did not
originate from getBankFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteBanks()
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. false
if Bank
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteBank(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Bank.
bankId
- the Id
of the Bank
to
removeNotFoundException
- bankId
not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. boolean canManageBankAliases()
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. false
if Bank
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasBank(Id bankId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
bankId
- the Id
of a Bank
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- bankId
not foundNullArgumentException
- bankId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented.