Interface AssessmentOfferedAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AssessmentOfferedBatchAdminSession
This session creates, updates, and deletes AssessmentsOffered .
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
AssessmentOffered , an AssessmentOfferedForm is requested
using getAssessmentOfferedFormForCreate() specifying the
assessment and desired record Types or none if no record
Types are needed. The returned AssessmentOfferedForm 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
AssessmentOfferedForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each AssessmentOfferedForm corresponds to an
attempted transaction.
For updates, AssessmentOfferedForms are requested to the
AssessmentOffered Id that is to be updated using
getAssessmentOfferedFormForUpdate() . Similarly, the
AssessmentOfferedForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
AssessmentOfferedForm can only be used once for a successful update and
cannot be reused.
The delete operations delete AssessmentsOffered . To unmap an
AssessmentOffered from the current Bank , the
AssessmentOfferedBankAssignmentSession should be used. These delete
operations attempt to remove the AssessmentOffered 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 TypeMethodDescriptionvoidaliasAssessmentOffered(Id assessmentOfferedId, Id aliasId) Adds anIdto anAssessmentOfferedfor the purpose of creating compatibility.booleancanCreateAssessmentOfferedWithRecordTypes(Type[] assessmentOfferedRecordTypes) Tests if this user can create a singleAssessmentOfferedusing the desired record types.booleanTests if this user can createAssessmentOfferedobjects.booleanTests if this user can deleteAssessmentsOffered.booleanTests if this user can manageIdaliases forAssessmentsOffered.booleanTests if this user can updateAssessmentOfferedobjects.createAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) Creates a newAssessmentOffered.voiddeleteAssessmentOffered(Id assessmentOfferedId) Deletes anAssessmentOffered.getAssessmentOfferedFormForCreate(Id assessmentId, Type[] assessmentOfferedRecordTypes) Gets the assessment offered form for creating new assessments offered.getAssessmentOfferedFormForUpdate(Id assessmentOfferedId) Gets the assessment offered form for updating an existing assessment offered.getBank()Gets theBankassociated with this session.Gets theBankIdassociated with this session.voidupdateAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) Updates an existing assessment offered.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.
-
canCreateAssessmentsOffered
boolean canCreateAssessmentsOffered()Tests if this user can createAssessmentOfferedobjects. A return of true does not guarantee successful authoriization. A return of false indicates that it is known creating anAssessmentOfferedwill 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:
falseifAssessmentOfferedcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessmentOfferedWithRecordTypes
Tests if this user can create a singleAssessmentOfferedusing the desired record types. WhileAssessmentManager.getAssessmentOfferedRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAssessmentOffered. Providing an empty array tests if anAssessmentOfferedcan be created with no records.- Parameters:
assessmentOfferedRecordTypes- array of assessment offered record types- Returns:
trueifAssessmentOfferedcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-assessmentOfferedRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAssessmentOfferedFormForCreate
AssessmentOfferedForm getAssessmentOfferedFormForCreate(Id assessmentId, Type[] assessmentOfferedRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment offered form for creating new assessments offered. A new form should be requested for each create transaction.- Parameters:
assessmentId- theIdof the relatedAssessmentassessmentOfferedRecordTypes- array of assessment offered record types to be included in the create operation or an empty list if none- Returns:
- the assessment offered form
- Throws:
NotFoundException-assessmentIdis not foundNullArgumentException-assessmentIdorassessmentOfferedRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssessmentOffered
AssessmentOffered createAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) throws OperationFailedException, PermissionDeniedException Creates a newAssessmentOffered.- Parameters:
assessmentOfferedForm- the form for thisAssessmentOffered- Returns:
- the new
AssessmentOffered - Throws:
IllegalStateException-assessmentOffreredFormalready 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.
-
canUpdateAssessmentsOffered
boolean canUpdateAssessmentsOffered()Tests if this user can updateAssessmentOfferedobjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAssessmentOfferedwill 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.
-
getAssessmentOfferedFormForUpdate
AssessmentOfferedForm getAssessmentOfferedFormForUpdate(Id assessmentOfferedId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment offered form for updating an existing assessment offered. A new assessment offered form should be requested for each update transaction.- Parameters:
assessmentOfferedId- theIdof theAssessmentOffered- Returns:
- the assessment offered form
- Throws:
NotFoundException-assessmentOfferedIdis not foundNullArgumentException-assessmentOfferedIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
updateAssessmentOffered
void updateAssessmentOffered(AssessmentOfferedForm assessmentOfferedForm) throws OperationFailedException, PermissionDeniedException Updates an existing assessment offered.- Parameters:
assessmentOfferedForm- the form containing the elements to be updated- Throws:
IllegalStateException-assessmentOffreredFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-assessmentOfferedFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentFormdid not originate fromgetAssessmentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAssessmentsOffered
boolean canDeleteAssessmentsOffered()Tests if this user can deleteAssessmentsOffered. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAssessmentOfferedwill 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:
falseifAssessmentOffereddeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAssessmentOffered
void deleteAssessmentOffered(Id assessmentOfferedId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAssessmentOffered.- Parameters:
assessmentOfferedId- theIdof theAssessmentOfferedto remove- Throws:
NotFoundException-assessmentOfferedIdnot foundNullArgumentException-assessmentOfferedIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canManageAssessmentOfferedAliases
boolean canManageAssessmentOfferedAliases()Tests if this user can manageIdaliases forAssessmentsOffered. 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:
falseifAssessmentOfferedaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAssessmentOffered
void aliasAssessmentOffered(Id assessmentOfferedId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAssessmentOfferedfor the purpose of creating compatibility. The primaryIdof theAssessmentOfferedis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another assessment offered, it is reassigned to the given assessment offeredId.- Parameters:
assessmentOfferedId- theIdof anAssessmentOfferedaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-assessmentOfferedIdnot foundNullArgumentException-assessmentOfferedIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-