public interface EnrollmentBatchAdminSession extends EnrollmentAdminSession
This session creates, updates, and deletes Enrollments
in bulk. 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 getEnrollmentFormsForCreate()
specifying the desired
activity, student, and record Types
or none if no record
Types
are needed. Each of the returned
EnrollmentForms
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 an 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.
The EnrollmentForms
returned from
getEnrollmentFormsForCreate()
may be linked to the originating
request through the peer Ids
of the EnrollmentForm.
In the case where there may be duplicates, any
EnrollmentForm
of the same peer Ids
may be used for
a create operation.
Once a batch of EnrollmentForms
are submitted for
create, a CreateResponse
is returned for each
EnrollmentForm,
although the ordering is not defined. Only errors
that pertain to the entire create operation are returned from
createEnrollments(),
errors specific to an individual
EnrollmentForm
are indicated in the corresponding
CreateResponse.
CreateResponses
may be linked to
the originating EnrollmentForm
through the
EnrollmentForm
Id
.
For updates, EnrollmentForms
are requested to the
Enrollment
Id
that is to be updated using
getEnrollmentFormsForUpdate()
where the reference Id
in the EnrollmentForm
may be used to link the
request. 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.
Once a batch of EnrollmentForms
are submitted for
update, an UpdateResponse
is returned for each
EnrollmentForm,
although the ordering is not defined. Only errors
that pertain to the entire update operation are returned from
updateEnrollments(),
errors specific to an individual
EnrollmentForm
are indicated in the corresponding
UpdateResponse.
UpdateResponses
may be linked to
the originating EnrollmentForm
through the
EnrollmentForm
Id.
The delete operations delete Enrollments
in bulk. To
unmap an Enrollment
from the current CourseCatalog,
the EnrollmentCourseCatalogAssignmentSession
should
be used. These delete operations attempt to remove the Enrollment
itself thus removing it from all known CourseCatalog
catalogs. Bulk delete operations return the results in
DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasEnrollments(AliasRequestList aliasRequests)
Adds an
Id to an Enrollment for the
purpose of creating compatibility. |
CreateResponseList |
createEnrollments(EnrollmentBatchFormList enrollmentForms)
Creates a new set of
Enrollments. |
DeleteResponseList |
deleteAllEnrollments()
Deletes all
Enrollments in this CourseCatalog
. |
DeleteResponseList |
deleteEnrollments(IdList enrollmentIds)
Deletes enrollments for the given
Ids. |
DeleteResponseList |
deleteEnrollmentsForProgramOffering(Id programOfferingId)
Deletes enrollments for the given program offering.
|
DeleteResponseList |
deleteEnrollmentsForStudent(Id resourceId)
Deletes enrollments for the given student resource.
|
DeleteResponseList |
deleteIneffectiveEnrollmentsByDate(DateTime date)
Deletes enrollments expired before the given date.
|
EnrollmentBatchFormList |
getEnrollmentFormsForCreate(EnrollmentPeerList peers,
Type[] enrollmentRecordTypes)
Gets the enrollment forms for creating a bunch of new enrollments.
|
EnrollmentBatchFormList |
getEnrollmentFormsForUpdate(IdList enrollmentIds)
Gets the enrollment forms for updating an existing set of enrollments.
|
UpdateResponseList |
updateEnrollments(EnrollmentBatchFormList enrollmentForms)
Updates existing enrollments.
|
aliasEnrollment, canCreateEnrollments, canCreateEnrollmentWithRecordTypes, canDeleteEnrollments, canManageEnrollmentAliases, canUpdateEnrollments, createEnrollment, deleteEnrollment, getCourseCatalog, getCourseCatalogId, getEnrollmentFormForCreate, getEnrollmentFormForUpdate, updateEnrollment
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
EnrollmentBatchFormList getEnrollmentFormsForCreate(EnrollmentPeerList peers, Type[] enrollmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers
- the relationship peersenrollmentRecordTypes
- array of enrollment record types to be
included in each create operation or an empty list if noneNotFoundException
- a programId
or
resourceId
is not foundNullArgumentException
- peers
or
enrollmentRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createEnrollments(EnrollmentBatchFormList enrollmentForms) throws OperationFailedException, PermissionDeniedException
Enrollments.
This method returns
an error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.enrollmentForms
- the enrollment formsNullArgumentException
- enrollmentForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. EnrollmentBatchFormList getEnrollmentFormsForUpdate(IdList enrollmentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
enrollmentIds
- the Ids
of the Enrollment
NotFoundException
- an enrollmentId
is
not foundNullArgumentException
- enrollmentIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateEnrollments(EnrollmentBatchFormList enrollmentForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.enrollmentForms
- the form containing the elements to be updatedNullArgumentException
- enrollmentForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllEnrollments() throws OperationFailedException, PermissionDeniedException
Enrollments
in this CourseCatalog
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteEnrollments(IdList enrollmentIds) throws OperationFailedException, PermissionDeniedException
Ids.
enrollmentIds
- the Ids
of the enrollments to
deleteNullArgumentException
- enrollmentIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteEnrollmentsForProgramOffering(Id programOfferingId) throws OperationFailedException, PermissionDeniedException
programOfferingId
- an Id
of a programNullArgumentException
- programOfferingId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteEnrollmentsForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException
resourceId
- an Id
of a resourceNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveEnrollmentsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasEnrollments(AliasRequestList aliasRequests) throws 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
is an alias to the primary Id.
If the
alias is a pointer to another enrollment, it is reassigned to the
given enrollment Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.