public interface EnrollmentAdminSession extends OsidSession
This session creates, updates, and deletes Enrollments.
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
Enrollment, an EnrollmentForm is requested
using getEnrollmentFormFormForCreate() specifying the
desired record Types or none if no record Types
are needed. The returned EnrollmentForm 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
EnrollmentForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each EnrollmentForm corresponds to an
attempted transaction.
For updates, EnrollmentForms are requested to the
EnrollmentForm Id that is to be updated
using getEnrollmentFormForUpdate(). Similarly, the
EnrollmentForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
EnrollmentForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Enrollments. To unmap an
EnrollmentForm from the current CourseCatalog,
the EnrollmentCourseCatalogAssignmentSession should
be used. These delete operations attempt to remove the
EnrollmentForm itself thus removing it from all known
CourseCatalog 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 |
aliasEnrollment(Id enrollmentId,
Id aliasId)
Adds an
Id to an Enrollment for the
purpose of creating compatibility. |
boolean |
canCreateEnrollments()
Tests if this user can create
Enrollments. |
boolean |
canCreateEnrollmentWithRecordTypes(Type[] enrollmentRecordTypes)
Tests if this user can create a single
Enrollment using
the desired record types. |
boolean |
canDeleteEnrollments()
Tests if this user can delete
Enrollments. |
boolean |
canManageEnrollmentAliases()
Tests if this user can manage
Id aliases for
Enrollments. |
boolean |
canUpdateEnrollments()
Tests if this user can update
Enrollments. |
Enrollment |
createEnrollment(EnrollmentForm enrollmentForm)
Creates a new
Enrollment. |
void |
deleteEnrollment(Id enrollmentId)
Deletes an
Enrollment. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
EnrollmentForm |
getEnrollmentFormForCreate(Id programOfferingId,
Id resourceId,
Type[] enrollmentRecordTypes)
Gets the course form for creating new enrollments.
|
EnrollmentForm |
getEnrollmentFormForUpdate(Id enrollmentId)
Gets the enrollment form for updating an existing enrollment.
|
void |
updateEnrollment(EnrollmentForm enrollmentForm)
Updates an existing enrollment.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getCourseCatalogId()
CourseCatalog Id associated
with this session. CourseCatalog Id associated with this
sessionmandatory - This method must be implemented. CourseCatalog getCourseCatalog() throws OperationFailedException, PermissionDeniedException
CourseCatalog associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateEnrollments()
Enrollments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Enrollment 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 Enrollment creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateEnrollmentWithRecordTypes(Type[] enrollmentRecordTypes)
Enrollment using
the desired record types. While
CourseProgramManager.getEnrollmentRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Enrollment.
Providing an empty array tests if an Enrollment can be
created with no records.enrollmentRecordTypes - array of enrollment record types true if Enrollment creation
using the specified record Types is supported,
false otherwiseNullArgumentException - enrollmentRecordTypes
is null mandatory - This method must be implemented. EnrollmentForm getEnrollmentFormForCreate(Id programOfferingId, Id resourceId, Type[] enrollmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
programOfferingId - the Id for a
ProgramOffering resourceId - the Id for a Resource enrollmentRecordTypes - array of enrollment record typesNotFoundException - programOfferingId,
or resourceId is not foundNullArgumentException - programOfferingId,
resourceId, or enrollmentRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
recod typesmandatory - This method must be implemented. Enrollment createEnrollment(EnrollmentForm enrollmentForm) throws OperationFailedException, PermissionDeniedException
Enrollment. enrollmentForm - the form for this Enrollment Enrollment IllegalStateException - enrollmentForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - enrollmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - enrollmentForm
did not originate from getEnrollmentFormForCreate()
mandatory - This method must be implemented. boolean canUpdateEnrollments()
Enrollments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Enrollment 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 Enrollment modification
is not authorized, true otherwisemandatory - This method must be implemented. EnrollmentForm getEnrollmentFormForUpdate(Id enrollmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
enrollmentId - the Id of the Enrollment
NotFoundException - enrollmentId is not
foundNullArgumentException - enrollmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateEnrollment(EnrollmentForm enrollmentForm) throws OperationFailedException, PermissionDeniedException
enrollmentForm - the form containing the elements to be updatedIllegalStateException - enrollmentForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - enrollmentForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - enrollmentForm
did not originate from getEnrollmentFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteEnrollments()
Enrollments. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Enrollment 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 Enrollment deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteEnrollment(Id enrollmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Enrollment. enrollmentId - the Id of the Enrollment
to removeNotFoundException - enrollmentId not
foundNullArgumentException - enrollmentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageEnrollmentAliases()
Id aliases for
Enrollments. 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 Enrollment aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasEnrollment(Id enrollmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Enrollment for the
purpose of creating compatibility. The primary Id of
the Enrollment is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another enrollment, it is
reassigned to the given enrollment Id. enrollmentId - the Id of an Enrollment
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - enrollmentId not
foundNullArgumentException - enrollmentId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.