Interface EntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, EntryAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Entries 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 an
Entry , an EntryForm is requested using
getEntryFormsForCreate() specifying the desired entry slot, period,
record Types or none if no record Types are needed. Each
of the returned EntryForms 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 an EntryForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each EntryForm corresponds to an
attempted transaction.
The EntryForms returned from getEntryFormsForCreate()
may be linked to the originating request through the peer Ids of
the EntryForm . In the case where there may be duplicates, any
EntryForm of the same peer Ids may be used for a create
operation.
Once a batch of EntryForms are submitted for create, a
CreateResponse is returned for each EntryForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createEntries() , errors specific to
an individual EntryForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
EntryForm through the EntryForm Id .
For updates, EntryForms are requested to the Entry
Id that is to be updated using getEntryFormsForUpdate()
where the reference Id in the EntryForm may be used to
link the request. Similarly, the EntryForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The EntryForm can only be used once for a successful
update and cannot be reused.
Once a batch of EntryForms are submitted for update, an
UpdateResponse is returned for each EntryForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateEntries() , errors specific to
an individual EntryForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
EntryForm through the EntryForm Id .
The delete operations delete Entries in bulk. To unmap an
Entry from the current Business , the
EntryBusinessAssignmentSession should be used. These delete operations
attempt to remove the Entry itself thus removing it from all known
Business catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasEntries(AliasRequestList aliasRequests) Adds anIdto anEntryfor the purpose of creating compatibility.createEntries(EntryBatchFormList entryForms) Creates a new set ofEntries.Deletes allEntriesin thisBusiness.deleteEntries(IdList entryIds) Deletes entries for the givenIds.deleteEntriesForCustomer(Id customerId) Deletes entries for the given customer.deleteEntriesForPeriod(Id periodId) Deletes entries for the given period.Deletes entries expired before the given date.getEntryFormsForCreate(EntryPeerList peers, Type[] entryRecordTypes) Gets the entry forms for creating a bunch of new entries.getEntryFormsForUpdate(IdList entryIds) Gets the entry forms for updating an existing set of entries.updateEntries(EntryBatchFormList entryForms) Updates existing entries.Methods inherited from interface EntryAdminSession
aliasEntry, canCreateEntries, canCreateEntryWithRecordTypes, canDeleteEntries, canManageEntryAliases, canUpdateEntries, createEntry, deleteEntry, getBusiness, getBusinessId, getEntryFormForCreate, getEntryFormForUpdate, updateEntryModifier and TypeMethodDescriptionvoidaliasEntry(Id entryId, Id aliasId) Adds anIdto anEntryfor the purpose of creating compatibility.booleanTests if this user can createEntries.booleancanCreateEntryWithRecordTypes(Type[] entryRecordTypes) Tests if this user can create a singleEntryusing the desired record types.booleanTests if this user can deleteEntries.booleanTests if this user can manageIdaliases forEntries.booleanTests if this user can updateEntries.createEntry(EntryForm entryForm) Creates a newEntry.voiddeleteEntry(Id entryId) Deletes anEntry.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.getEntryFormForCreate(Id customerId, Id itemId, Id periodId, Type[] entryRecordTypes) Gets the entry form for creating new entries.getEntryFormForUpdate(Id entryId) Gets the entry form for updating an existing entry.voidupdateEntry(EntryForm entryForm) Updates an existing entry.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
-
getEntryFormsForCreate
EntryBatchFormList getEntryFormsForCreate(EntryPeerList peers, Type[] entryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the entry forms for creating a bunch of new entries. A form is returned for each supplied customer, item, and period set.- Parameters:
peers- the entry peersentryRecordTypes- array of entry record types to be included in each create operation or an empty list if none- Returns:
- the entry forms
- Throws:
NotFoundException- acustomerId, itemId, orperiodIdis not foundNullArgumentException-peersorentryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createEntries
CreateResponseList createEntries(EntryBatchFormList entryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
entryForms- the entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-entryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getEntryFormsForUpdate
EntryBatchFormList getEntryFormsForUpdate(IdList entryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the entry forms for updating an existing set of entries. A new entry form should be requested for each update transaction.- Parameters:
entryIds- theIdsof theEntry- Returns:
- the entry form
- Throws:
NotFoundException- anentryIdis not foundNullArgumentException-entryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEntries
UpdateResponseList updateEntries(EntryBatchFormList entryForms) throws OperationFailedException, PermissionDeniedException Updates existing entries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
entryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-entryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllEntries
Deletes allEntriesin thisBusiness.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEntries
DeleteResponseList deleteEntries(IdList entryIds) throws OperationFailedException, PermissionDeniedException Deletes entries for the givenIds.- Parameters:
entryIds- theIdsof the entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-entryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEntriesForCustomer
DeleteResponseList deleteEntriesForCustomer(Id customerId) throws OperationFailedException, PermissionDeniedException Deletes entries for the given customer.- Parameters:
customerId- anIdof a customer- Returns:
- the delete responses
- Throws:
NullArgumentException-customerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEntriesForPeriod
DeleteResponseList deleteEntriesForPeriod(Id periodId) throws OperationFailedException, PermissionDeniedException Deletes entries for the given period.- Parameters:
periodId- anIdof a period- Returns:
- the delete responses
- Throws:
NullArgumentException-periodIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveEntriesByDate
DeleteResponseList deleteIneffectiveEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes 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.
-
aliasEntries
AliasResponseList aliasEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anEntryfor the purpose of creating compatibility. The primaryIdof theEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another entry, it is reassigned to the given 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.
-