Interface InquiryAdminSession

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

public interface InquiryAdminSession extends OsidSession

This session creates, updates, and deletes Inquiries . 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 Inquiry , an InquiryForm is requested using getInquiryFormForCreate() specifying the desired audit and record Types or none if no record Types are needed. The returned InquiryForm 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 InquiryForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each InquiryForm corresponds to an attempted transaction.

For updates, InquiryForms are requested to the Inquiry Id that is to be updated using getInquiryFormForUpdate() . Similarly, the InquiryForm has metadata about the data that can be updated and it can perform validation before submitting the update. The InquiryForm can only be used once for a successful update and cannot be reused.

The delete operations delete Inquiries . To unmap an Inquiry from the current Inquest , the InquiryInquestAssignmentSession should be used. These delete operations attempt to remove the Inquiry 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.
    • canCreateInquiries

      boolean canCreateInquiries()
      Tests if this user can create Inquiries . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Inquiry 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 Inquiry creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateInquiryWithRecordTypes

      boolean canCreateInquiryWithRecordTypes(Type[] inquiryRecordTypes)
      Tests if this user can create a single Inquiry using the desired record types. While InquiryManager.getInquiryRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Inquiry . Providing an empty array tests if an Inquiry can be created with no records.
      Parameters:
      inquiryRecordTypes - array of inquiry record types
      Returns:
      true if Inquiry creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - inquiryRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getInquiryFormForCreate

      InquiryForm getInquiryFormForCreate(Id auditId, Type[] inquiryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the inquiry form for creating new inquiries. A new form should be requested for each create transaction.
      Parameters:
      auditId - the Id for the audit
      inquiryRecordTypes - array of inquiry record types
      Returns:
      the inquiry form
      Throws:
      NotFoundException - auditId is not found
      NullArgumentException - auditId or inquiryRecordTypes 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.
    • createInquiry

      Creates a new Inquiry .
      Parameters:
      inquiryForm - the form for this Inquiry
      Returns:
      the new Inquiry
      Throws:
      IllegalStateException - inquiryForm already used in a create transaction.
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - inquiryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - inquiryForm did not originate from getInquiryFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateInquiries

      boolean canUpdateInquiries()
      Tests if this user can update Inquiries . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Inquiry 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 Inquiry modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getInquiryFormForUpdate

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

      void updateInquiry(InquiryForm inquiryForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing inquiry.
      Parameters:
      inquiryForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - inquiryForm already used in an update transatcion
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - inquiryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - inquiryForm did not originate from getInquiryFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteInquiries

      boolean canDeleteInquiries()
      Tests if this user can delete Inquiries . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Inquiry 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 Inquiry deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteInquiry

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

      boolean canManageInquiryAliases()
      Tests if this user can manage Id aliases for Inquiries . 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 Inquiry aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasInquiry

      Adds an Id to an Inquiry for the purpose of creating compatibility. The primary Id of the Inquiry is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another inquiry, it is reassigned to the given inquiry Id .
      Parameters:
      inquiryId - the Id of an Inquiry
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - inquiryId not found
      NullArgumentException - inquiryId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canSequenceInquiries

      boolean canSequenceInquiries()
      Tests if this user can order Inquiries . A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.
      Returns:
      false if Inquiry ordering is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • moveInquiryAhead

      void moveInquiryAhead(Id inquiryId, Id auditId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Reorders inquiries in an audit by moving the specified inquiry in front of a reference inquiry.
      Parameters:
      inquiryId - the Id of an Inquiry
      auditId - the Id of an Audit
      referenceId - the reference inquiry Id
      Throws:
      NotFoundException - inquiryId, auditId , or referenceId not found or, inquiryId or referenceId not related to auditId
      NullArgumentException - inquiryId, auditId , or referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • moveInquiryBehind

      void moveInquiryBehind(Id inquiryId, Id auditId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Reorders inquiries in an audit by moving the specified inquiry behind a reference inquiry.
      Parameters:
      inquiryId - the Id of an Inquiry
      auditId - the Id of an Audit
      referenceId - the reference inquiry Id
      Throws:
      NotFoundException - inquiryId, auditId , or referenceId not found or, inquiryId or referenceId not related to auditId
      NullArgumentException - inquiryId, auditId , or referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • orderInquiries

      void orderInquiries(Id[] inquiryIds, Id auditId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Reorders a set of inquiries in an audit.
      Parameters:
      inquiryIds - the Ids for a set of Inquiries
      auditId - the Id of an Audit
      Throws:
      NotFoundException - auditId not found or, an inquiryId not related to auditId
      NullArgumentException - inquiryIds or auditId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.