Interface AssessmentTakenAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AssessmentTakenBatchAdminSession
This session creates, updates, and deletes AssessmentsTaken .
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
AssessmentTaken , an AssessmentTakenForm is requested
using getAssessmentTakenFormForCreate() specifying the assessment
offered and desired record Types or none if no record
Types are needed. The returned AssessmentTakenForm 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
AssessmentTakenForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each AssessmentTakenForm corresponds to an attempted
transaction.
For updates, AssessmentTakenForms are requested to the
AssessmentTaken Id that is to be updated using
getAssessmentTakenFormForUpdate() . Similarly, the
AssessmentTakenForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
AssessmentTakenForm can only be used once for a successful update and
cannot be reused.
The delete operations delete AssessmentsTaken . To unmap an
AssessmentTakenForm from the current Bank , the
AssessmentTakenFormBankAssignmentSession should be used. These delete
operations attempt to remove the AssessmentTakenForm 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 TypeMethodDescriptionvoidaliasAssessmentTaken(Id assessmentTakenId, Id aliasId) Adds anIdto anAssessmentTakenfor the purpose of creating compatibility.booleanTests if this user can createAssessmentTakenobjects.booleancanCreateAssessmentTakenWithRecordTypes(Type[] assessmentTakenRecordTypes) Tests if this user can create a singleAssessmentTakenusing the desired record types.booleanTests if this user can deleteAssessmentsTaken.booleanTests if this user can manageIdaliases forAssessmentsTaken.booleanTests if this user can updateAssessmentTakenobjects.createAssessmentTaken(AssessmentTakenForm assessmentTakenForm) Creates a newAssessmentTaken.voiddeleteAssessmentTaken(Id assessmentTakenId) Deletes anAssessmentTaken.getAssessmentTakenFormForCreate(Id assessmentOfferedId, Type[] assessmentTakenRecordTypes) Gets the assessment taken form for creating new assessments taken.getAssessmentTakenFormForUpdate(Id assessmentTakenId) Gets the assessment taken form for updating an existing assessment taken.getBank()Gets theBankassociated with this session.Gets theBankIdassociated with this session.voidupdateAssessmentTaken(AssessmentTakenForm assessmentTakenForm) Updates an existing assessment taken.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.
-
canCreateAssessmentsTaken
boolean canCreateAssessmentsTaken()Tests if this user can createAssessmentTakenobjects. A return of true does not guarantee successful authoriization. A return of false indicates that it is known creating anAssessmentTakenwill 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:
falseifAssessmentTakencreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessmentTakenWithRecordTypes
Tests if this user can create a singleAssessmentTakenusing the desired record types. WhileAssessmentManager.getAssessmentTakenRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAssessmentTaken. Providing an empty array tests if anAssessmentTakencan be created with no records.- Parameters:
assessmentTakenRecordTypes- array of assessment taken record types- Returns:
trueifAssessmentTakencreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-assessmentTakenRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAssessmentTakenFormForCreate
AssessmentTakenForm getAssessmentTakenFormForCreate(Id assessmentOfferedId, Type[] assessmentTakenRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment taken form for creating new assessments taken. A new form should be requested for each create transaction.- Parameters:
assessmentOfferedId- theIdof the relatedAssessmentOfferedassessmentTakenRecordTypes- array of assessment taken record types to be included in the create operation or an empty list if none- Returns:
- the assessment taken form
- Throws:
NotFoundException-assessmentOfferedIdis not foundNullArgumentException-assessmentOfferedIdorassessmentTakenRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssessmentTaken
AssessmentTaken createAssessmentTaken(AssessmentTakenForm assessmentTakenForm) throws OperationFailedException, PermissionDeniedException Creates a newAssessmentTaken.- Parameters:
assessmentTakenForm- the form for thisAssessmentTaken- Returns:
- the new
AssessmentTaken - Throws:
IllegalStateException-assessmentTakenFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-assessmentTakenFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentOfferedFormdid not originate fromgetAssessmentTakenFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAssessmentsTaken
boolean canUpdateAssessmentsTaken()Tests if this user can updateAssessmentTakenobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAssessmentTakenwill 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:
falseifAssessmentTakenmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAssessmentTakenFormForUpdate
AssessmentTakenForm getAssessmentTakenFormForUpdate(Id assessmentTakenId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment taken form for updating an existing assessment taken. A new assessment taken form should be requested for each update transaction.- Parameters:
assessmentTakenId- theIdof theAssessmentTaken- Returns:
- the assessment taken form
- Throws:
NotFoundException-assessmentTakenIdis not foundNullArgumentException-assessmentTakenIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
updateAssessmentTaken
void updateAssessmentTaken(AssessmentTakenForm assessmentTakenForm) throws OperationFailedException, PermissionDeniedException Updates an existing assessment taken.- Parameters:
assessmentTakenForm- the form containing the elements to be updated- Throws:
IllegalStateException-assessmentTakenFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-assessmentTakenFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentOfferedFormdid not originate fromgetAssessmentTakenFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAssessmentsTaken
boolean canDeleteAssessmentsTaken()Tests if this user can deleteAssessmentsTaken. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAssessmentTakenwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operations to unauthorized users.- Returns:
falseifAssessmentTakendeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAssessmentTaken
void deleteAssessmentTaken(Id assessmentTakenId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAssessmentTaken.- Parameters:
assessmentTakenId- theIdof theAssessmentTakento remove- Throws:
NotFoundException-assessmentTakenIdnot foundNullArgumentException-assessmentTakenIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canManageAssessmentTakenAliases
boolean canManageAssessmentTakenAliases()Tests if this user can manageIdaliases forAssessmentsTaken. 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:
falseifAssessmentTakenaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAssessmentTaken
void aliasAssessmentTaken(Id assessmentTakenId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAssessmentTakenfor the purpose of creating compatibility. The primaryIdof theAssessmentTakenis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another assessment taken, it is reassigned to the given assessment takenId.- Parameters:
assessmentTakenId- theIdof anAssessmentTakenaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-assessmentTakenIdnot foundNullArgumentException-assessmentTakenIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-