Interface BankBatchAdminSession
- All Superinterfaces:
AutoCloseable, BankAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Banks in bulk. 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
getBankFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
BankForms 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 a
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.
The BankForms returned from getBankFormsForCreate()
may be linked to the originating request through the peer Ids of
the BankForm . In the case where there may be duplicates, any
BankForm of the same peer Ids may be used for a create
operation.
Once a batch of BankForms are submitted for create, a
CreateResponse is returned for each BankForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createBanks() , errors specific to an
individual BankForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
BankForm through the BankForm Id .
For updates, BankForms are requested to the Bank
Id that is to be updated using getBankFormsForUpdate()
where the reference Id in the BankForm may be used to link
the request. 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.
Once a batch of BankForms are submitted for update, an
UpdateResponse is returned for each BankForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateBanks() , errors specific to an
individual BankForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
BankForm through the BankForm Id .
The delete operations delete Banks in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBanks(AliasRequestList aliasRequests) Adds anIdto aBankfor the purpose of creating compatibility.createBanks(BankBatchFormList bankForms) Creates a new set ofBanks.Deletes allBanks.deleteBanks(IdList bankIds) Deletes banks for the givenIds.getBankFormsForCreate(long number, Type[] bankRecordTypes) Gets the bank forms for creating a bunch of new banks.getBankFormsForUpdate(IdList bankIds) Gets the bank forms for updating an existing set of banks.updateBanks(BankBatchFormList bankForms) Updates existing banks.Methods inherited from interface BankAdminSession
aliasBank, canCreateBanks, canCreateBankWithRecordTypes, canDeleteBanks, canManageBankAliases, canUpdateBanks, createBank, deleteBank, getBankFormForCreate, getBankFormForUpdate, updateBankModifier 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
-
getBankFormsForCreate
BankBatchFormList getBankFormsForCreate(long number, Type[] bankRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the bank forms for creating a bunch of new banks.- Parameters:
number- the number of forms to retrievebankRecordTypes- array of bank record types to be included in each create operation or an empty list if none- Returns:
- the bank forms
- Throws:
NullArgumentException-bankRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBanks
CreateResponseList createBanks(BankBatchFormList bankForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBanks. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
bankForms- the bank forms- Returns:
- the create responses
- Throws:
NullArgumentException-bankFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBankFormsForUpdate
BankBatchFormList getBankFormsForUpdate(IdList bankIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the bank forms for updating an existing set of banks. A new bank form should be requested for each update transaction.- Parameters:
bankIds- theIdsof theBank- Returns:
- the bank form
- Throws:
NotFoundException- abankIdis not foundNullArgumentException-bankIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBanks
UpdateResponseList updateBanks(BankBatchFormList bankForms) throws OperationFailedException, PermissionDeniedException Updates existing banks. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
bankForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-bankFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBanks
Deletes allBanks.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBanks
DeleteResponseList deleteBanks(IdList bankIds) throws OperationFailedException, PermissionDeniedException Deletes banks for the givenIds.- Parameters:
bankIds- theIdsof the banks to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-bankIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBanks
AliasResponseList aliasBanks(AliasRequestList aliasRequests) throws 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:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-