Interface AuditAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
AuditBatchAdminSession

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.

  • Method Details

    • getInquestId

      Id getInquestId()
      Gets the Inquest Id associated with this session.
      Returns:
      the Inquest Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getInquest

      Gets the Inquest associated with this session.
      Returns:
      the inquest
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 an 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.
      Returns:
      false if Audit creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAuditWithRecordTypes

      boolean canCreateAuditWithRecordTypes(Type[] auditRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      auditRecordTypes - array of audit record types
      Returns:
      true if Audit creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - auditRecordTypes is null
      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 - auditRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createAudit

      Creates a new Audit .
      Parameters:
      auditForm - the form for this Audit
      Returns:
      the new Audit
      Throws:
      IllegalStateException - auditForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - auditForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - auditForm did not originate from getAuditFormForCreate()
      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 an 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.
      Returns:
      false if Audit modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAuditFormForUpdate

      Gets the audit form for updating an existing audit. A new audit form should be requested for each update transaction.
      Parameters:
      auditId - the Id of the Audit
      Returns:
      the audit form
      Throws:
      NotFoundException - auditId is not found
      NullArgumentException - auditId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateAudit

      void updateAudit(AuditForm auditForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing audit.
      Parameters:
      auditForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - auditForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - auditForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - auditForm did not originate from getAuditFormForUpdate()
      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 an 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.
      Returns:
      false if Audit deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteAudit

      Deletes an Audit .
      Parameters:
      auditId - the Id of the Audit to remove
      Throws:
      NotFoundException - auditId not found
      NullArgumentException - auditId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageAuditAliases

      boolean canManageAuditAliases()
      Tests if this user can manage 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.
      Returns:
      false if Audit aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasAudit

      Adds an 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 .
      Parameters:
      auditId - the Id of an Audit
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - auditId not found
      NullArgumentException - auditId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.