Interface EnrollmentBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, EnrollmentAdminSession, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasEnrollments(AliasRequestList aliasRequests) Adds anIdto anEnrollmentfor the purpose of creating compatibility.createEnrollments(EnrollmentBatchFormList enrollmentForms) Creates a new set ofEnrollments.Deletes allEnrollmentsin thisCourseCatalog.deleteEnrollments(IdList enrollmentIds) Deletes enrollments for the givenIds.deleteEnrollmentsForProgramOffering(Id programOfferingId) Deletes enrollments for the given program offering.deleteEnrollmentsForStudent(Id resourceId) Deletes enrollments for the given student resource.Deletes enrollments expired before the given date.getEnrollmentFormsForCreate(EnrollmentPeerList peers, Type[] enrollmentRecordTypes) Gets the enrollment forms for creating a bunch of new enrollments.getEnrollmentFormsForUpdate(IdList enrollmentIds) Gets the enrollment forms for updating an existing set of enrollments.updateEnrollments(EnrollmentBatchFormList enrollmentForms) Updates existing enrollments.Methods inherited from interface EnrollmentAdminSession
aliasEnrollment, canCreateEnrollments, canCreateEnrollmentWithRecordTypes, canDeleteEnrollments, canManageEnrollmentAliases, canUpdateEnrollments, createEnrollment, deleteEnrollment, getCourseCatalog, getCourseCatalogId, getEnrollmentFormForCreate, getEnrollmentFormForUpdate, updateEnrollmentModifier and TypeMethodDescriptionvoidaliasEnrollment(Id enrollmentId, Id aliasId) Adds anIdto anEnrollmentfor the purpose of creating compatibility.booleanTests if this user can createEnrollments.booleancanCreateEnrollmentWithRecordTypes(Type[] enrollmentRecordTypes) Tests if this user can create a singleEnrollmentusing the desired record types.booleanTests if this user can deleteEnrollments.booleanTests if this user can manageIdaliases forEnrollments.booleanTests if this user can updateEnrollments.createEnrollment(EnrollmentForm enrollmentForm) Creates a newEnrollment.voiddeleteEnrollment(Id enrollmentId) Deletes anEnrollment.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getEnrollmentFormForCreate(Id programOfferingId, Id resourceId, Type[] enrollmentRecordTypes) Gets the course form for creating new enrollments.getEnrollmentFormForUpdate(Id enrollmentId) Gets the enrollment form for updating an existing enrollment.voidupdateEnrollment(EnrollmentForm enrollmentForm) Updates an existing enrollment.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
-
getEnrollmentFormsForCreate
EnrollmentBatchFormList getEnrollmentFormsForCreate(EnrollmentPeerList peers, Type[] enrollmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the enrollment forms for creating a bunch of new enrollments. A form is returned for each activity and resource pair.- Parameters:
peers- the relationship peersenrollmentRecordTypes- array of enrollment record types to be included in each create operation or an empty list if none- Returns:
- the enrollment forms
- Throws:
NotFoundException- aprogramIdorresourceIdis not foundNullArgumentException-peersorenrollmentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createEnrollments
CreateResponseList createEnrollments(EnrollmentBatchFormList enrollmentForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofEnrollments. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
enrollmentForms- the enrollment forms- Returns:
- the create responses
- Throws:
NullArgumentException-enrollmentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getEnrollmentFormsForUpdate
EnrollmentBatchFormList getEnrollmentFormsForUpdate(IdList enrollmentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the enrollment forms for updating an existing set of enrollments. A new enrollment form should be requested for each update transaction.- Parameters:
enrollmentIds- theIdsof theEnrollment- Returns:
- the enrollment form
- Throws:
NotFoundException- anenrollmentIdis not foundNullArgumentException-enrollmentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEnrollments
UpdateResponseList updateEnrollments(EnrollmentBatchFormList enrollmentForms) throws OperationFailedException, PermissionDeniedException Updates existing enrollments. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
enrollmentForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-enrollmentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllEnrollments
DeleteResponseList deleteAllEnrollments() throws OperationFailedException, PermissionDeniedExceptionDeletes allEnrollmentsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEnrollments
DeleteResponseList deleteEnrollments(IdList enrollmentIds) throws OperationFailedException, PermissionDeniedException Deletes enrollments for the givenIds.- Parameters:
enrollmentIds- theIdsof the enrollments to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-enrollmentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEnrollmentsForProgramOffering
DeleteResponseList deleteEnrollmentsForProgramOffering(Id programOfferingId) throws OperationFailedException, PermissionDeniedException Deletes enrollments for the given program offering.- Parameters:
programOfferingId- anIdof a program- Returns:
- the delete responses
- Throws:
NullArgumentException-programOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEnrollmentsForStudent
DeleteResponseList deleteEnrollmentsForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes enrollments for the given student resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveEnrollmentsByDate
DeleteResponseList deleteIneffectiveEnrollmentsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes enrollments expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasEnrollments
AliasResponseList aliasEnrollments(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anEnrollmentfor the purpose of creating compatibility. The primaryIdof theEnrollmentis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another enrollment, it is reassigned to the given enrollmentId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-