public interface AssessmentAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasAssessment(Id assessmentId,
Id aliasId)
Adds an
Id to an Assessment for the
purpose of creating compatibility. |
boolean |
canCreateAssessments()
Tests if this user can create
Assessments. |
boolean |
canCreateAssessmentWithRecordTypes(Type[] assessmentRecordTypes)
Tests if this user can create a single
Assessment using
the desired record interface types. |
boolean |
canDeleteAssessments()
Tests if this user can delete
Assessments. |
boolean |
canManageAssessmentAliases()
Tests if this user can manage
Id aliases for
Assessments. |
boolean |
canUpdateAssessments()
Tests if this user can update
Assessments. |
Assessment |
createAssessment(AssessmentForm assessmentForm)
Creates a new
Assessment. |
void |
deleteAssessment(Id assessmentId)
Deletes an
Assessment. |
AssessmentForm |
getAssessmentFormForCreate(Type[] assessmentRecordTypes)
Gets the assessment form for creating new assessments.
|
AssessmentForm |
getAssessmentFormForUpdate(Id assessmentId)
Gets the assessment form for updating an existing assessment.
|
Bank |
getBank()
Gets the
Bank associated with this session. |
Id |
getBankId()
Gets the
Bank Id associated with this
session. |
void |
updateAssessment(AssessmentForm assessmentForm)
Updates an existing assessment.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBankId()
Bank Id associated with this
session. Bank Id associated with this sessionmandatory - This method must be implemented. Bank getBank() throws OperationFailedException, PermissionDeniedException
Bank associated with this session. Bank associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. boolean canCreateAssessments()
Assessments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Assessment will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false if Assessment creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAssessmentWithRecordTypes(Type[] assessmentRecordTypes)
Assessment using
the desired record interface types. While
AssessmentManager.getAssessmentRecordTypes() can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Assessment.
Providing an empty array tests if an Assessment
can be created with no records.assessmentRecordTypes - array of assessment record types true if Assessment creation
using the specified record Types is supported,
false otherwiseNullArgumentException - assessmentRecordTypes
is null mandatory - This method must be implemented. AssessmentForm getAssessmentFormForCreate(Type[] assessmentRecordTypes) throws OperationFailedException, PermissionDeniedException
assessmentRecordTypes - array of assessment record types to be
included in the create operation or an empty list if noneNullArgumentException - assessmentRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Assessment createAssessment(AssessmentForm assessmentForm) throws OperationFailedException, PermissionDeniedException
Assessment. assessmentForm - the form for this Assessment Assessment IllegalStateException - assessmentForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - assessmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredUnsupportedException - assessmentForm
did not originate from getAssessmentFormForCreate()
mandatory - This method must be implemented. boolean canUpdateAssessments()
Assessments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Assessment will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false if Assessment modification
is not authorized, true otherwisemandatory - This method must be implemented. AssessmentForm getAssessmentFormForUpdate(Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
assessmentId - the Id of the Assessment
NotFoundException - assessmentId is not
foundNullArgumentException - assessmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. void updateAssessment(AssessmentForm assessmentForm) throws OperationFailedException, PermissionDeniedException
assessmentForm - the form containing the elements to be updatedIllegalStateException - assessmentForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - assessmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredUnsupportedException - assessmentForm did not
originate from getAssessmentFormForUpdate() mandatory - This method must be implemented. boolean canDeleteAssessments()
Assessments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Assessment will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false if Assessment deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteAssessment(Id assessmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Assessment. assessmentId - the Id of the Assessment
to removeNotFoundException - assessmentId not
foundNullArgumentException - assessmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. boolean canManageAssessmentAliases()
Id aliases for
Assessments. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Assessment aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasAssessment(Id assessmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Assessment for the
purpose of creating compatibility. The primary Id of
the Assessment is determined by the provider. The new
Id is an alias to the primary Id. If the
alias is a pointer to another assessment, it is reassigned to the
given assessment Id. assessmentId - the Id of an Assessment
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - assessmentId not
foundNullArgumentException - assessmentId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented.