Interface AssessmentAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AssessmentBatchAdminSession
This session creates, updates, and deletes Assessments . 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
Assessment , an AssessmentForm is requested using
getAssessmentFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
AssessmentForm 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 AssessmentForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each AssessmentForm corresponds
to an attempted transaction.
For updates, AssessmentForms are requested to the
Assessment Id that is to be updated using
getAssessmentFormForUpdate() . Similarly, the AssessmentForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The AssessmentForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Assessments . To unmap an
Assessment from the current Bank , the
AssessmentBankAssignmentSession should be used. These delete operations
attempt to remove the Assessment itself thus removing it from all
known Bank catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAssessment(Id assessmentId, Id aliasId) Adds anIdto anAssessmentfor the purpose of creating compatibility.booleanTests if this user can createAssessments.booleancanCreateAssessmentWithRecordTypes(Type[] assessmentRecordTypes) Tests if this user can create a singleAssessmentusing the desired record interface types.booleanTests if this user can deleteAssessments.booleanTests if this user can manageIdaliases forAssessments.booleanTests if this user can updateAssessments.createAssessment(AssessmentForm assessmentForm) Creates a newAssessment.voiddeleteAssessment(Id assessmentId) Deletes anAssessment.getAssessmentFormForCreate(Type[] assessmentRecordTypes) Gets the assessment form for creating new assessments.getAssessmentFormForUpdate(Id assessmentId) Gets the assessment form for updating an existing assessment.getBank()Gets theBankassociated with this session.Gets theBankIdassociated with this session.voidupdateAssessment(AssessmentForm assessmentForm) Updates an existing assessment.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
-
getBankId
Id getBankId()Gets theBankIdassociated with this session.- Returns:
- the
Bank Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBank
Gets theBankassociated with this session.- Returns:
- the
Bankassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessments
boolean canCreateAssessments()Tests if this user can createAssessments. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAssessmentwill 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:
falseifAssessmentcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessmentWithRecordTypes
Tests if this user can create a singleAssessmentusing the desired record interface types. WhileAssessmentManager.getAssessmentRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificAssessment. Providing an empty array tests if anAssessmentcan be created with no records.- Parameters:
assessmentRecordTypes- array of assessment record types- Returns:
trueifAssessmentcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-assessmentRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAssessmentFormForCreate
AssessmentForm getAssessmentFormForCreate(Type[] assessmentRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the assessment form for creating new assessments. A new form should be requested for each create transaction.- Parameters:
assessmentRecordTypes- array of assessment record types to be included in the create operation or an empty list if none- Returns:
- the assessment form
- Throws:
NullArgumentException-assessmentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssessment
Assessment createAssessment(AssessmentForm assessmentForm) throws OperationFailedException, PermissionDeniedException Creates a newAssessment.- Parameters:
assessmentForm- the form for thisAssessment- Returns:
- the new
Assessment - Throws:
IllegalStateException-assessmentFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-assessmentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentFormdid not originate fromgetAssessmentFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAssessments
boolean canUpdateAssessments()Tests if this user can updateAssessments. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAssessmentwill 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:
falseifAssessmentmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAssessmentFormForUpdate
AssessmentForm getAssessmentFormForUpdate(Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment form for updating an existing assessment. A new assessment form should be requested for each update transaction.- Parameters:
assessmentId- theIdof theAssessment- Returns:
- the assessment form
- Throws:
NotFoundException-assessmentIdis not foundNullArgumentException-assessmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
updateAssessment
void updateAssessment(AssessmentForm assessmentForm) throws OperationFailedException, PermissionDeniedException Updates an existing assessment.- Parameters:
assessmentForm- the form containing the elements to be updated- Throws:
IllegalStateException-assessmentFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-assessmentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentForm did not originate from getAssessmentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAssessments
boolean canDeleteAssessments()Tests if this user can deleteAssessments. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAssessmentwill 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:
falseifAssessmentdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAssessment
void deleteAssessment(Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAssessment.- Parameters:
assessmentId- theIdof theAssessmentto remove- Throws:
NotFoundException-assessmentIdnot foundNullArgumentException-assessmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canManageAssessmentAliases
boolean canManageAssessmentAliases()Tests if this user can manageIdaliases forAssessments. 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:
falseifAssessmentaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAssessment
void aliasAssessment(Id assessmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAssessmentfor the purpose of creating compatibility. The primaryIdof theAssessmentis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another assessment, it is reassigned to the given assessmentId.- Parameters:
assessmentId- theIdof anAssessmentaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-assessmentIdnot foundNullArgumentException-assessmentIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-