Interface RegistrationBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, RegistrationAdminSession
This session creates, updates, and deletes Registrations 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 a
Registration , a RegistrationForm is requested using
getRegistrationFormsForCreate() specifying the desired activity bundle,
student, and record Types or none if no record Types are
needed. Each of the returned RegistrationForms 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 a
RegistrationForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each RegistrationForm corresponds to an attempted transaction.
The RegistrationForms returned from
getRegistrationFormsForCreate() may be linked to the originating request
through the peer Ids of the RegistrationForm . In the case
where there may be duplicates, any RegistrationForm of the same
peer Ids may be used for a create operation.
Once a batch of RegistrationForms are submitted for create, a
CreateResponse is returned for each RegistrationForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createRegistrations() ,
errors specific to an individual RegistrationForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating RegistrationForm through the
RegistrationForm Id .
For updates, RegistrationForms are requested to the
Registration Id that is to be updated using
getRegistrationFormsForUpdate() where the reference Id in the
RegistrationForm may be used to link the request. Similarly, the
RegistrationForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
RegistrationForm can only be used once for a successful update and cannot
be reused.
Once a batch of RegistrationForms are submitted for update, an
UpdateResponse is returned for each RegistrationForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateRegistrations() ,
errors specific to an individual RegistrationForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating RegistrationForm through the
RegistrationForm Id .
The delete operations delete Registrations in bulk. To unmap a
Registration from the current CourseCatalog , the
RegistrationCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the Registration itself thus removing
it from all known CourseCatalog catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasRegistrations(AliasRequestList aliasRequests) Adds anIdto aRegistrationfor the purpose of creating compatibility.createRegistrations(RegistrationBatchFormList registrationForms) Creates a new set ofRegistrations.Deletes allRegistrationsin thisCourseCatalog.Deletes registrations expired before the given date.deleteRegistrations(IdList registrationIds) Deletes registrations for the givenIds.deleteRegistrationsForActivity(Id activityId) Deletes registrations indirectly related to the given activity.deleteRegistrationsForActivityBundle(Id activityBundleId) Deletes registrations for the given activity bundle.deleteRegistrationsForCourseOffering(Id courseOfferingId) Deletes registrations indirectly related to the given course offering.deleteRegistrationsForStudent(Id resourceId) Deletes registrations for the given student.getRegistrationFormsForCreate(RegistrationPeerList peers, Type[] registrationRecordTypes) Gets the registration forms for creating a bunch of new registrations.getRegistrationFormsForUpdate(IdList registrationIds) Gets the registration forms for updating an existing set of registrations.updateRegistrations(RegistrationBatchFormList registrationForms) Updates existing registrations.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.Methods inherited from interface RegistrationAdminSession
aliasRegistration, canCreateRegistrations, canCreateRegistrationWithRecordTypes, canDeleteRegistrations, canManageRegistrationAliases, canUpdateRegistrations, createRegistration, deleteRegistration, getCourseCatalog, getCourseCatalogId, getRegistrationFormForCreate, getRegistrationFormForUpdate, updateRegistrationModifier and TypeMethodDescriptionvoidaliasRegistration(Id registrationId, Id aliasId) Adds anIdto aRegistrationfor the purpose of creating compatibility.booleanTests if this user can createRegistrations.booleancanCreateRegistrationWithRecordTypes(Type[] registrationRecordTypes) Tests if this user can create a singleRegistrationusing the desired record types.booleanTests if this user can deleteRegistrations.booleanTests if this user can manageIdaliases forRegistrations.booleanTests if this user can updateRegistrations.createRegistration(RegistrationForm registrationForm) Creates a newRegistration.voiddeleteRegistration(Id registrationId) Deletes aRegistration.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getRegistrationFormForCreate(Id courseRegistrationId, Id registrationTargetId, Id resourceId, Type[] registrationRecordTypes) Gets the registration form for creating new registrations.getRegistrationFormForUpdate(Id registrationId) Gets the registration form for updating an existing registration.voidupdateRegistration(RegistrationForm registrationForm) Updates an existing registration.
-
Method Details
-
getRegistrationFormsForCreate
RegistrationBatchFormList getRegistrationFormsForCreate(RegistrationPeerList peers, Type[] registrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration forms for creating a bunch of new registrations. A form is returned for supplied activity bundle and student pair.- Parameters:
peers- a list of course offering peersregistrationRecordTypes- array of registration record types to be included in each create operation or an empty list if none- Returns:
- the registration forms
- Throws:
NotFoundException- anactivityBundleIdorresourceIdis not foundNullArgumentException-peersorregistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createRegistrations
CreateResponseList createRegistrations(RegistrationBatchFormList registrationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofRegistrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
registrationForms- the registration forms- Returns:
- the create responses
- Throws:
NullArgumentException-registrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRegistrationFormsForUpdate
RegistrationBatchFormList getRegistrationFormsForUpdate(IdList registrationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration forms for updating an existing set of registrations. A new registration form should be requested for each update transaction.- Parameters:
registrationIds- theIdsof theRegistrations- Returns:
- the registration form
- Throws:
NotFoundException- aregistrationIdis not foundNullArgumentException-registrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRegistrations
UpdateResponseList updateRegistrations(RegistrationBatchFormList registrationForms) throws OperationFailedException, PermissionDeniedException Updates existing registrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
registrationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-registrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllRegistrations
DeleteResponseList deleteAllRegistrations() throws OperationFailedException, PermissionDeniedExceptionDeletes allRegistrationsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrations
DeleteResponseList deleteRegistrations(IdList registrationIds) throws OperationFailedException, PermissionDeniedException Deletes registrations for the givenIds.- Parameters:
registrationIds- theIdsof the registrations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-registrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrationsForActivityBundle
DeleteResponseList deleteRegistrationsForActivityBundle(Id activityBundleId) throws OperationFailedException, PermissionDeniedException Deletes registrations for the given activity bundle.- Parameters:
activityBundleId- theIdof an activity bundle- Returns:
- the delete responses
- Throws:
NullArgumentException-actviityBundleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrationsForStudent
DeleteResponseList deleteRegistrationsForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes registrations for the given student.- Parameters:
resourceId- theIdof a student resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrationsForActivity
DeleteResponseList deleteRegistrationsForActivity(Id activityId) throws OperationFailedException, PermissionDeniedException Deletes registrations indirectly related to the given activity.- Parameters:
activityId- theIdof an activity- Returns:
- the delete responses
- Throws:
NullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrationsForCourseOffering
DeleteResponseList deleteRegistrationsForCourseOffering(Id courseOfferingId) throws OperationFailedException, PermissionDeniedException Deletes registrations indirectly related to the given course offering.- Parameters:
courseOfferingId- theIdof a course offering- Returns:
- the delete responses
- Throws:
NullArgumentException-courseOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveRegistrationsByDate
DeleteResponseList deleteIneffectiveRegistrationsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes registrations 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.
-
aliasRegistrations
AliasResponseList aliasRegistrations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aRegistrationfor the purpose of creating compatibility. The primaryIdof theRegistrationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another registration, it is reassigned to the given registrationId.- 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.
-