Interface InquestAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
InquestBatchAdminSession
This session creates, updates, and deletes Inquests . 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
Inquest , an InquestForm is requested using
getInquestFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
InquestForm 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 InquestForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each InquestForm corresponds to an attempted
transaction.
For updates, InquestForms are requested to the Inquest
Id that is to be updated using getInquestFormForUpdate() .
Similarly, the InquestForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
InquestForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Inquests .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasInquest(Id inquestId, Id aliasId) Adds anIdto anInquestfor the purpose of creating compatibility.booleanTests if this user can createInquests.booleancanCreateInquestWithRecordTypes(Type[] inquestRecordTypes) Tests if this user can create a singleInquestusing the desired record types.booleanTests if this user can deleteInquests.booleanTests if this user can manageIdaliases forInquests.booleanTests if this user can updateInquests.createInquest(InquestForm inquestForm) Creates a newInquest.voiddeleteInquest(Id inquestId) Deletes anInquest.getInquestFormForCreate(Type[] inquestRecordTypes) Gets the inquest form for creating new inquests.getInquestFormForUpdate(Id inquestId) Gets the inquest form for updating an existing inquest.voidupdateInquest(InquestForm inquestForm) Updates an existing inquestMethods 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
-
canCreateInquests
boolean canCreateInquests()Tests if this user can createInquests. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anInquest. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifInquestcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateInquestWithRecordTypes
Tests if this user can create a singleInquestusing the desired record types. WhileControlManager.getInquestRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificInquest. Providing an empty array tests if anInquestcan be created with no records.- Parameters:
inquestRecordTypes- array of inquest record types- Returns:
trueifInquestcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-inquestRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getInquestFormForCreate
InquestForm getInquestFormForCreate(Type[] inquestRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the inquest form for creating new inquests. A new form should be requested for each create transaction.- Parameters:
inquestRecordTypes- array of inquest record types- Returns:
- the inquest form
- Throws:
NullArgumentException-inquestRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createInquest
Inquest createInquest(InquestForm inquestForm) throws OperationFailedException, PermissionDeniedException Creates a newInquest.- Parameters:
inquestForm- the form for thisInquest- Returns:
- the new
Inquest - Throws:
IllegalStateException-inquestFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-inquestFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inquestFormdid not originate fromgetInquestFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateInquests
boolean canUpdateInquests()Tests if this user can updateInquests. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anInquestwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifInquestmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getInquestFormForUpdate
InquestForm getInquestFormForUpdate(Id inquestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the inquest form for updating an existing inquest. A new inquest form should be requested for each update transaction.- Parameters:
inquestId- theIdof theInquest- Returns:
- the inquest form
- Throws:
NotFoundException-inquestIdis not foundNullArgumentException-inquestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateInquest
void updateInquest(InquestForm inquestForm) throws OperationFailedException, PermissionDeniedException Updates an existing inquest- Parameters:
inquestForm- the form containing the elements to be updated- Throws:
IllegalStateException-inquestFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-inquestFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-inquestFormdid not originate fromgetInquestFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteInquests
boolean canDeleteInquests()Tests if this user can deleteInquests. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anInquestwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifInquestdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteInquest
void deleteInquest(Id inquestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anInquest.- Parameters:
inquestId- theIdof theInquestto remove- Throws:
NotFoundException-inquestIdnot foundNullArgumentException-inquestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageInquestAliases
boolean canManageInquestAliases()Tests if this user can manageIdaliases forInquests. 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:
falseifInquestaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasInquest
void aliasInquest(Id inquestId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anInquestfor the purpose of creating compatibility. The primaryIdof theInquestis determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
inquestId- theIdof anInquestaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-inquestIdnot foundNullArgumentException-inquestIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-