Interface AuditAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AuditBatchAdminSession
This session creates, updates, and deletes Audits . 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
Audit , an AuditForm is requested using
getAuditFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned AuditForm
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
AuditForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each AuditForm corresponds to an attempted transaction.
For updates, AuditForms are requested to the Audit
Id that is to be updated using getAuditFormForUpdate() .
Similarly, the AuditForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
AuditForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Audits . To unmap an
Audit from the current Inquest , the
AuditInquestAssignmentSession should be used. These delete operations
attempt to remove the Audit itself thus removing it from all known
Inquest catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getInquestId
Id getInquestId()Gets theInquestIdassociated with this session.- Returns:
- the
Inquest Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getInquest
Gets theInquestassociated with this session.- Returns:
- the inquest
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAudit
boolean canCreateAudit()Tests if this user can create audits. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAuditwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifAuditcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAuditWithRecordTypes
Tests if this user can create a singleAuditusing the desired record types. WhileControlManager.getAuditRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAudit. Providing an empty array tests if anAuditcan be created with no records.- Parameters:
auditRecordTypes- array of audit record types- Returns:
trueifAuditcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-auditRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAuditFormForCreate
AuditForm getAuditFormForCreate(Type[] auditRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the audit form for creating new audits. A new form should be requested for each create transaction.- Parameters:
auditRecordTypes- array of audit record types- Returns:
- the audit form
- Throws:
NullArgumentException-auditRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAudit
Creates a newAudit.- Parameters:
auditForm- the form for thisAudit- Returns:
- the new
Audit - Throws:
IllegalStateException-auditFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-auditFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-auditFormdid not originate fromgetAuditFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAudits
boolean canUpdateAudits()Tests if this user can update audits. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAuditwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifAuditmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAuditFormForUpdate
AuditForm getAuditFormForUpdate(Id auditId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the audit form for updating an existing audit. A new audit form should be requested for each update transaction.- Parameters:
auditId- theIdof theAudit- Returns:
- the audit form
- Throws:
NotFoundException-auditIdis not foundNullArgumentException-auditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAudit
Updates an existing audit.- Parameters:
auditForm- the form containing the elements to be updated- Throws:
IllegalStateException-auditFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-auditFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-auditFormdid not originate fromgetAuditFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAudits
boolean canDeleteAudits()Tests if this user can delete audits. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAuditwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifAuditdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAudit
void deleteAudit(Id auditId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAudit.- Parameters:
auditId- theIdof theAuditto remove- Throws:
NotFoundException-auditIdnot foundNullArgumentException-auditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAuditAliases
boolean canManageAuditAliases()Tests if this user can manageIdaliases for audits. 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:
falseifAuditaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAudit
void aliasAudit(Id auditId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAuditfor the purpose of creating compatibility. The primaryIdof theAuditis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another audit, it is reassigned to the given auditId.- Parameters:
auditId- theIdof anAuditaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-auditIdnot foundNullArgumentException-auditIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-