Interface AuditBatchAdminSession
- All Superinterfaces:
AuditAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and deletes Audits in bulk. The data for
create is provided by the consumer via the form object. OsidForms
are requested for each create or update and may not be reused.
To create an Audit , an AuditForm is requested using
getAuditFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the returned
AuditForms 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 AuditForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each AuditForms corresponds to an attempted
transaction.
The AuditForms returned from
getSubtaskFormsForCreate() may be linked to the originating request
through the peer Ids of the AuditForm . In the case where
there may be duplicates, any AuditForm of the same peer
Ids may be used for a create operation.
Once a batch of AuditForms are submitted for create, a
CreateResponse is returned for each AuditForms , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createSubtasks() , errors specific to
an individual AuditForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
AuditForm through the AuditForm Id .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAudits(AliasRequestList aliasRequests) Adds anIdto anAuditfor the purpose of creating compatibility.createAudits(AuditBatchFormList auditForms) Creates a new set ofAudits.Deletes allAuditsin thisInquest.getAuditFormsForCreate(long n, Type[] auditRecordTypes) Gets the audit forms for creating a bunch of new audtits.getAuditFormsForUpdate(IdList auditIds) Gets the audit forms for updating an existing set of audits.updateAudits(AuditBatchFormList auditForms) Updates existing auditis.Methods inherited from interface AuditAdminSession
aliasAudit, canCreateAudit, canCreateAuditWithRecordTypes, canDeleteAudits, canManageAuditAliases, canUpdateAudits, createAudit, deleteAudit, getAuditFormForCreate, getAuditFormForUpdate, getInquest, getInquestId, updateAuditModifier and TypeMethodDescriptionvoidaliasAudit(Id auditId, Id aliasId) Adds anIdto anAuditfor the purpose of creating compatibility.booleanTests if this user can create audits.booleancanCreateAuditWithRecordTypes(Type[] auditRecordTypes) Tests if this user can create a singleAuditusing the desired record types.booleanTests if this user can delete audits.booleanTests if this user can manageIdaliases for audits.booleanTests if this user can update audits.createAudit(AuditForm auditForm) Creates a newAudit.voiddeleteAudit(Id auditId) Deletes anAudit.getAuditFormForCreate(Type[] auditRecordTypes) Gets the audit form for creating new audits.getAuditFormForUpdate(Id auditId) Gets the audit form for updating an existing audit.Gets theInquestassociated with this session.Gets theInquestIdassociated with this session.voidupdateAudit(AuditForm auditForm) Updates an existing audit.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
-
getAuditFormsForCreate
AuditBatchFormList getAuditFormsForCreate(long n, Type[] auditRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the audit forms for creating a bunch of new audtits.- Parameters:
n- number of forms to retrieveauditRecordTypes- array of audtit record types to be included in each create operation or an empty list if none- Returns:
- the audit forms
- Throws:
NullArgumentException-auditRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAudits
CreateResponseList createAudits(AuditBatchFormList auditForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAudits. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
auditForms- the audit forms- Returns:
- the create responses
- Throws:
NullArgumentException-auditFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAuditFormsForUpdate
AuditBatchFormList getAuditFormsForUpdate(IdList auditIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the audit forms for updating an existing set of audits. A new audit form should be requested for each update transaction.- Parameters:
auditIds- theIdsof theAudits- Returns:
- the audit forms
- Throws:
NotFoundException- anauditIdis not foundNullArgumentException-auditIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAudits
UpdateResponseList updateAudits(AuditBatchFormList auditForms) throws OperationFailedException, PermissionDeniedException Updates existing auditis. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
auditForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-auditFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAudits
Deletes allAuditsin thisInquest.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAudits
AliasResponseList aliasAudits(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAuditfor the purpose of creating compatibility. The primaryIdof theAuditis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another audit, it is reassigned to the given auditId.- 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.
-