public interface AuditAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasAudit(Id auditId,
Id aliasId)
Adds an
Id to an Audit for the purpose
of creating compatibility. |
boolean |
canCreateAudit()
Tests if this user can create audits.
|
boolean |
canCreateAuditWithRecordTypes(Type[] auditRecordTypes)
Tests if this user can create a single
Audit using the
desired record types. |
boolean |
canDeleteAudits()
Tests if this user can delete audits.
|
boolean |
canManageAuditAliases()
Tests if this user can manage
Id aliases for audits. |
boolean |
canUpdateAudits()
Tests if this user can update audits.
|
Audit |
createAudit(AuditForm auditForm)
Creates a new
Audit. |
void |
deleteAudit(Id auditId)
Deletes an
Audit. |
AuditForm |
getAuditFormForCreate(Type[] auditRecordTypes)
Gets the audit form for creating new audits.
|
AuditForm |
getAuditFormForUpdate(Id auditId)
Gets the audit form for updating an existing audit.
|
Inquest |
getInquest()
Gets the
Inquest associated with this session. |
Id |
getInquestId()
Gets the
Inquest Id associated with this
session. |
void |
updateAudit(AuditForm auditForm)
Updates an existing audit.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getInquestId()
Inquest Id associated with this
session. Inquest Id associated with this sessionmandatory - This method must be implemented. Inquest getInquest() throws OperationFailedException, PermissionDeniedException
Inquest associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateAudit()
Audit will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer create operations to an
unauthorized user. false if Audit creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAuditWithRecordTypes(Type[] auditRecordTypes)
Audit using the
desired record types. While
ControlManager.getAuditRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Audit. Providing an
empty array tests if an Audit can be created with no
records.auditRecordTypes - array of audit record types true if Audit creation using the
specified record Types is supported,
false otherwiseNullArgumentException - auditRecordTypes
is null mandatory - This method must be implemented. AuditForm getAuditFormForCreate(Type[] auditRecordTypes) throws OperationFailedException, PermissionDeniedException
auditRecordTypes - array of audit record typesNullArgumentException - auditRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Audit createAudit(AuditForm auditForm) throws OperationFailedException, PermissionDeniedException
Audit. auditForm - the form for this Audit Audit IllegalStateException - auditForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - auditForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - auditForm did not
originate from getAuditFormForCreate() mandatory - This method must be implemented. boolean canUpdateAudits()
Audit will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer update operations to an
unauthorized user. false if Audit modification is
not authorized, true otherwisemandatory - This method must be implemented. AuditForm getAuditFormForUpdate(Id auditId) throws NotFoundException, OperationFailedException, PermissionDeniedException
auditId - the Id of the Audit NotFoundException - auditId is not foundNullArgumentException - auditId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateAudit(AuditForm auditForm) throws OperationFailedException, PermissionDeniedException
auditForm - the form containing the elements to be updatedIllegalStateException - auditForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - auditForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - auditForm did not
originate from getAuditFormForUpdate() mandatory - This method must be implemented. boolean canDeleteAudits()
Audit will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer delete operations to an
unauthorized user. false if Audit deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteAudit(Id auditId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Audit. auditId - the Id of the Audit to
removeNotFoundException - auditId not foundNullArgumentException - auditId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageAuditAliases()
Id aliases 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 a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer alias operations to an
unauthorized user. false if Audit aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasAudit(Id auditId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Audit for the purpose
of creating compatibility. The primary Id of the
Audit is determined by the provider. The new Id
performs as an alias to the primary Id . If the alias
is a pointer to another audit, it is reassigned to the given audit
Id. auditId - the Id of an Audit aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - auditId not foundNullArgumentException - auditId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.