Interface BankAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
BankBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidAdds anIdto aBankfor the purpose of creating compatibility.booleanTests if this user can createBanks.booleancanCreateBankWithRecordTypes(Type[] bankRecordTypes) Tests if this user can create a singleBankusing the desired record types.booleanTests if this user can delete banks.booleanTests if this user can manageIdaliases forBanks.booleanTests if this user can updateBanks.createBank(BankForm bankForm) Creates a newBank.voiddeleteBank(Id bankId) Deletes aBank.getBankFormForCreate(Type[] bankRecordTypes) Gets the bank form for creating new banks.getBankFormForUpdate(Id bankId) Gets the bank form for updating an existing bank.voidupdateBank(BankForm bankForm) Updates an existing bank.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateBanks
boolean canCreateBanks()Tests if this user can createBanks. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aBankwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifBankcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBankWithRecordTypes
Tests if this user can create a singleBankusing the desired record types. WhileAssessmentManager.getBankRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBank. Providing an empty array tests if aBankcan be created with no records.- Parameters:
bankRecordTypes- array of bank record types- Returns:
trueifBankcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-bankRecordTypesisnull- 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-bankRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBank
Creates a newBank.- Parameters:
bankForm- the form for thisBank- Returns:
- the new
Bank - Throws:
IllegalStateException-bankFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-bankFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-bankFormdid not originate fromgetBankFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBanks
boolean canUpdateBanks()Tests if this user can updateBanks. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aBankwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifBankmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBankFormForUpdate
BankForm getBankFormForUpdate(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the bank form for updating an existing bank. A new bank form should be requested for each update transaction.- Parameters:
bankId- theIdof theBank- Returns:
- the bank form
- Throws:
NotFoundException-bankIdis not foundNullArgumentException-bankIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
updateBank
Updates an existing bank.- Parameters:
bankForm- the form containing the elements to be updated- Throws:
IllegalStateException-bankFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-bankFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-bankFormdid not originate fromgetBankFormForUpdate()- 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 aBankwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifBankdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBank
void deleteBank(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aBank.- Parameters:
bankId- theIdof theBankto remove- Throws:
NotFoundException-bankIdnot foundNullArgumentException-bankIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canManageBankAliases
boolean canManageBankAliases()Tests if this user can manageIdaliases forBanks. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifBankaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBank
void aliasBank(Id bankId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aBankfor the purpose of creating compatibility. The primaryIdof theBankis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another bank, it is reassigned to the given bankId.- Parameters:
bankId- theIdof aBankaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-bankIdnot foundNullArgumentException-bankIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-