Interface BudgetEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, BudgetEntryAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes BudgetEntries 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
BudgetEntry , a BudgetEntryForm is requested using
getBudgetEntryFormsForCreate() specifying the desired budgets, accounts,
and record Types or none if no record Types are needed.
Each of the returned BudgetEntryForms 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 BudgetEntryForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
BudgetEntryForm corresponds to an attempted transaction.
The BudgetEntryForms returned from
getBudgetEntryFormsForCreate() may be linked to the originating request
through the peer Ids of the BudgetEntryForm . In the case
where there may be duplicates, any BudgetEntryForm of the same
peer Ids may be used for a create operation.
Once a batch of BudgetEntryForms are submitted for create, a
CreateResponse is returned for each BudgetEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createBudgetEntries() ,
errors specific to an individual BudgetEntryForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating BudgetEntryForm through the
BudgetEntryForm Id .
For updates, BudgetEntryForms are requested to the
BudgetEntry Id that is to be updated using
getBudgetEntryFormsForUpdate() where the reference Id in the
BudgetEntryForm may be used to link the request. Similarly, the
BudgetEntryForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
BudgetEntryForm can only be used once for a successful update and cannot
be reused.
Once a batch of BudgetEntryForms are submitted for update, an
UpdateResponse is returned for each BudgetEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateBudgetEntries() ,
errors specific to an individual BudgetEntryForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating BudgetEntryForm through the
BudgetEntryForm Id .
The delete operations delete BudgetEntries in bulk. To unmap a
BudgetEntry from the current Business , the
BudgetEntryBusinessAssignmentSession should be used. These delete
operations attempt to remove the BudgetEntry itself thus removing
it from all known Business catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBudgetEntries(AliasRequestList aliasRequests) Adds anIdto aBudgetEntryfor the purpose of creating compatibility.createBudgetEntries(BudgetEntryBatchFormList budgetEntryForms) Creates a new set ofBudgetEntries.Deletes allBudgetEntriesin thisBusiness.deleteBudgetEntries(IdList budgetEntryIds) Deletes budget entries for the givenIds.deleteBudgetEntriesForAccount(Id accountId) Deletes budget entries for the given accountdeleteBudgetEntriesForBudget(Id budgetId) Deletes budget entries for the given budget.Deletes budget entries expired before the given date.getBudgetEntryFormsForCreate(BudgetEntryPeerList peers, Type[] budgetRecordTypes) Gets the budget entry forms for creating a bunch of new budgets.getBudgetEntryFormsForUpdate(IdList budgetEntryIds) Gets the budget entry forms for updating an existing set of budgets.updateBudgetEntries(BudgetEntryBatchFormList budgetEntryForms) Updates existing budgets.Methods inherited from interface BudgetEntryAdminSession
aliasBudgetEntry, canCreateBudgetEntries, canCreateBudgetEntryWithRecordTypes, canDeleteBudgetEntries, canManageBudgetEntryAliases, canUpdateBudgetEntries, createBudgetEntry, deleteBudgetEntry, getBudgetEntryFormForCreate, getBudgetEntryFormForUpdate, getBusiness, getBusinessId, updateBudgetEntryModifier and TypeMethodDescriptionvoidaliasBudgetEntry(Id budgetEntryId, Id aliasId) Adds anIdto anBudgetEntryfor the purpose of creating compatibility.booleanTests if this user can createBudgetEntries.booleancanCreateBudgetEntryWithRecordTypes(Type[] budgetEntryRecordTypes) Tests if this user can create a singleBudgetEntryusing the desired record types.booleanTests if this user can deleteBudgetEntries.booleanTests if this user can manageIdaliases forBudgetEntries.booleanTests if this user can updateBudgetEntries.createBudgetEntry(BudgetEntryForm entryForm) Creates a newBudgetEntry.voiddeleteBudgetEntry(Id budgetEntryId) Deletes anBudgetEntry.getBudgetEntryFormForCreate(Id budgetId, Id accountId, Type[] budgetEntryRecordTypes) Gets the budget entry form for creating new budget entries.getBudgetEntryFormForUpdate(Id budgetEntryId) Gets the budget entry form for updating an existing budget entries.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.voidupdateBudgetEntry(BudgetEntryForm budgetEntryForm) Updates an existing budget entries.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
-
getBudgetEntryFormsForCreate
BudgetEntryBatchFormList getBudgetEntryFormsForCreate(BudgetEntryPeerList peers, Type[] budgetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget entry forms for creating a bunch of new budgets. A form is returned for each supplied budget and account pair.- Parameters:
peers- a list of budgets and accountsbudgetRecordTypes- array of budget entry record types to be included in each create operation or an empty list if none- Returns:
- the budget entry forms
- Throws:
NotFoundException- abudgetIdoraccountIdis not foundNullArgumentException-peersorbudgetRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBudgetEntries
CreateResponseList createBudgetEntries(BudgetEntryBatchFormList budgetEntryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBudgetEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
budgetEntryForms- the budget entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-budgetEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBudgetEntryFormsForUpdate
BudgetEntryBatchFormList getBudgetEntryFormsForUpdate(IdList budgetEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the budget entry forms for updating an existing set of budgets. A new budget entry form should be requested for each update transaction.- Parameters:
budgetEntryIds- theIdsof theBudgetEntry- Returns:
- the budget entry form
- Throws:
NotFoundException- abudgetEntryIdis not foundNullArgumentException-budgetEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBudgetEntries
UpdateResponseList updateBudgetEntries(BudgetEntryBatchFormList budgetEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing budgets. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
budgetEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-budgetEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBudgetEntries
DeleteResponseList deleteAllBudgetEntries() throws OperationFailedException, PermissionDeniedExceptionDeletes allBudgetEntriesin thisBusiness.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetEntries
DeleteResponseList deleteBudgetEntries(IdList budgetEntryIds) throws OperationFailedException, PermissionDeniedException Deletes budget entries for the givenIds.- Parameters:
budgetEntryIds- theIdsof the budget entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-budgetEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetEntriesForBudget
DeleteResponseList deleteBudgetEntriesForBudget(Id budgetId) throws OperationFailedException, PermissionDeniedException Deletes budget entries for the given budget.- Parameters:
budgetId- theIdof a budget- Returns:
- the delete responses
- Throws:
NullArgumentException-budgetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBudgetEntriesForAccount
DeleteResponseList deleteBudgetEntriesForAccount(Id accountId) throws OperationFailedException, PermissionDeniedException Deletes budget entries for the given account- Parameters:
accountId- theIdof an account- Returns:
- the delete responses
- Throws:
NullArgumentException-accountIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveBudgetEntriesByDate
DeleteResponseList deleteIneffectiveBudgetEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes budget entries expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBudgetEntries
AliasResponseList aliasBudgetEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aBudgetEntryfor the purpose of creating compatibility. The primaryIdof theBudgetEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another budget entry, it is reassigned to the given budget entryId.- 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.
-