Interface InquiryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
InquiryBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidaliasInquiry(Id inquiryId, Id aliasId) Adds anIdto anInquiryfor the purpose of creating compatibility.booleanTests if this user can createInquiries.booleancanCreateInquiryWithRecordTypes(Type[] inquiryRecordTypes) Tests if this user can create a singleInquiryusing the desired record types.booleanTests if this user can deleteInquiries.booleanTests if this user can manageIdaliases forInquiries.booleanTests if this user can orderInquiries.booleanTests if this user can updateInquiries.createInquiry(InquiryForm inquiryForm) Creates a newInquiry.voiddeleteInquiry(Id inquiryId) Deletes anInquiry.Gets theInquestassociated with this session.Gets theInquestIdassociated with this session.getInquiryFormForCreate(Id auditId, Type[] inquiryRecordTypes) Gets the inquiry form for creating new inquiries.getInquiryFormForUpdate(Id inquiryId) Gets the inquiry form for updating an existing inquiry.voidmoveInquiryAhead(Id inquiryId, Id auditId, Id referenceId) Reorders inquiries in an audit by moving the specified inquiry in front of a reference inquiry.voidmoveInquiryBehind(Id inquiryId, Id auditId, Id referenceId) Reorders inquiries in an audit by moving the specified inquiry behind a reference inquiry.voidorderInquiries(Id[] inquiryIds, Id auditId) Reorders a set of inquiries in an audit.voidupdateInquiry(InquiryForm inquiryForm) Updates an existing inquiry.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.
-
canCreateInquiries
boolean canCreateInquiries()Tests if this user can createInquiries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anInquirywill 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:
falseifInquirycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateInquiryWithRecordTypes
Tests if this user can create a singleInquiryusing the desired record types. WhileInquiryManager.getInquiryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificInquiry. Providing an empty array tests if anInquirycan be created with no records.- Parameters:
inquiryRecordTypes- array of inquiry record types- Returns:
trueifInquirycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-inquiryRecordTypesisnull- 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- theIdfor the auditinquiryRecordTypes- array of inquiry record types- Returns:
- the inquiry form
- Throws:
NotFoundException-auditIdis not foundNullArgumentException-auditIdorinquiryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createInquiry
Inquiry createInquiry(InquiryForm inquiryForm) throws OperationFailedException, PermissionDeniedException Creates a newInquiry.- Parameters:
inquiryForm- the form for thisInquiry- Returns:
- the new
Inquiry - Throws:
IllegalStateException-inquiryFormalready used in a create transaction.InvalidArgumentException- one or more of the form elements is invalidNullArgumentException-inquiryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inquiryFormdid not originate fromgetInquiryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateInquiries
boolean canUpdateInquiries()Tests if this user can updateInquiries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anInquirywill 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:
falseifInquirymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getInquiryFormForUpdate
InquiryForm getInquiryFormForUpdate(Id inquiryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the inquiry form for updating an existing inquiry. A new inquiry form should be requested for each update transaction.- Parameters:
inquiryId- theIdof theInquiry- Returns:
- the inquiry form
- Throws:
NotFoundException-inquiryIdis not foundNullArgumentException-inquiryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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-inquiryFormalready used in an update transatcionInvalidArgumentException- the form contains an invalid valueNullArgumentException-inquiryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inquiryFormdid not originate fromgetInquiryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteInquiries
boolean canDeleteInquiries()Tests if this user can deleteInquiries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anInquirywill 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:
falseifInquirydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteInquiry
void deleteInquiry(Id inquiryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anInquiry.- Parameters:
inquiryId- theIdof theInquiryto remove- Throws:
NotFoundException-inquiryIdnot foundNullArgumentException-inquiryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageInquiryAliases
boolean canManageInquiryAliases()Tests if this user can manageIdaliases forInquiries. 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:
falseifInquiryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasInquiry
void aliasInquiry(Id inquiryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anInquiryfor the purpose of creating compatibility. The primaryIdof theInquiryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another inquiry, it is reassigned to the given inquiryId.- Parameters:
inquiryId- theIdof anInquiryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-inquiryIdnot foundNullArgumentException-inquiryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canSequenceInquiries
boolean canSequenceInquiries()Tests if this user can orderInquiries. A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.- Returns:
falseifInquiryordering is not authorized,trueotherwise- 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- theIdof anInquiryauditId- theIdof anAuditreferenceId- the reference inquiryId- Throws:
NotFoundException-inquiryId, auditId, orreferenceIdnot found or,inquiryIdorreferenceIdnot related toauditIdNullArgumentException-inquiryId, auditId, orreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof anInquiryauditId- theIdof anAuditreferenceId- the reference inquiryId- Throws:
NotFoundException-inquiryId, auditId, orreferenceIdnot found or,inquiryIdorreferenceIdnot related toauditIdNullArgumentException-inquiryId, auditId, orreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdsfor a set ofInquiriesauditId- theIdof anAudit- Throws:
NotFoundException-auditIdnot found or, aninquiryIdnot related toauditIdNullArgumentException-inquiryIdsorauditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-