Interface RegistrationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RegistrationBatchAdminSession
This session creates, updates, and deletes Registrations . 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
getRegistrationFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
RegistrationForm 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 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.
For updates, RegistrationForms are requested to the
RegistrationForm Id that is to be updated using
getRegistrationFormForUpdate() . 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.
The delete operations delete Registrations . To unmap a
Registration from the current CourseCatalog , the
RegistrationCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the RegistrationForm 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.
-
Method Summary
Modifier 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.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
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRegistrations
boolean canCreateRegistrations()Tests if this user can createRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRegistrationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifRegistrationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRegistrationWithRecordTypes
Tests if this user can create a singleRegistrationusing the desired record types. WhileCourseRegistrationManager.getRegistrationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRegistration. Providing an empty array tests if aRegistrationcan be created with no records.- Parameters:
registrationRecordTypes- array of registration record types- Returns:
trueifRegistrationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-registrationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRegistrationFormForCreate
RegistrationForm getRegistrationFormForCreate(Id courseRegistrationId, Id registrationTargetId, Id resourceId, Type[] registrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration form for creating new registrations. A new form should be requested for each create transaction.- Parameters:
courseRegistrationId- theIdof the course registrationregistrationTargetId- theIdof the registration targetresourceId- theIdof the studentregistrationRecordTypes- array of registration record types- Returns:
- the registration form
- Throws:
NotFoundException-courseRegistrationId, registrationTargetId, orresourceIdnot foundNullArgumentException-courseRegistrationId, registrationTargetId,resourceId, orregistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRegistration
Registration createRegistration(RegistrationForm registrationForm) throws NotFoundException, OperationFailedException, PermissionDeniedException Creates a newRegistration.- Parameters:
registrationForm- the form for thisRegistration- Returns:
- the new
Registration - Throws:
IllegalStateException-registrationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNotFoundException-registrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-registrationFormdid not originate fromgetRegistrationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRegistrations
boolean canUpdateRegistrations()Tests if this user can updateRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRegistrationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifRegistrationmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRegistrationFormForUpdate
RegistrationForm getRegistrationFormForUpdate(Id registrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration form for updating an existing registration. A new registration form should be requested for each update transaction.- Parameters:
registrationId- theIdof theRegistration- Returns:
- the registration form
- Throws:
NotFoundException-registrationIdis not foundNullArgumentException-registrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRegistration
void updateRegistration(RegistrationForm registrationForm) throws OperationFailedException, PermissionDeniedException Updates an existing registration.- Parameters:
registrationForm- the form containing the elements to be updated- Throws:
IllegalStateException-registrationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-registrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-registrationFormdid not originate fromgetRegistrationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRegistrations
boolean canDeleteRegistrations()Tests if this user can deleteRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRegistrationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifRegistrationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRegistration
void deleteRegistration(Id registrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRegistration.- Parameters:
registrationId- theIdof theRegistrationto remove- Throws:
NotFoundException-registrationIdnot foundNullArgumentException-registrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRegistrationAliases
boolean canManageRegistrationAliases()Tests if this user can manageIdaliases forRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifRegistrationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRegistration
void aliasRegistration(Id registrationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRegistrationfor the purpose of creating compatibility. The primaryIdof theCourseis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another registration, it is reassigned to the given registrationId.- Parameters:
registrationId- theIdof aRegistrationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-registrationIdnot foundNullArgumentException-registrationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-