Interface RegistrationTargetAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RegistrationTargetBatchAdminSession
This session creates, updates, and deletes RegistrationTar
gets. 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
RegistrationTa rget, a RegistrationTarge tForm is requested using
getRegistrationTargetFormForCre ate() specifying the desired
course offering and record Types or none if no record
Types are needed. The returned RegistrationTarge tForm 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
RegistrationTarge tForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each RegistrationTarge tForm corresponds to an
attempted transaction.
For updates, RegistrationTarget Forms are requested to the
RegistrationT arget Id that is to be updated using
getRegistrationTargetFormForUpda te(). Similarly, the
RegistrationTarge tForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
RegistrationTarge tForm can only be used once for a successful update and
cannot be reused.
The delete operations delete RegistrationTar gets. To unmap a
RegistrationT arget from the current CourseCatalog , the
RegistrationTargetCourseCatalogAssignmentSe ssion should be used.
These delete operations attempt to remove the RegistrationT arget
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 TypeMethodDescriptionvoidaliasRegistrationTarget(Id registrationTargetId, Id aliasId) Adds anIdto aRegistrationTarget for the purpose of creating compatibility.booleanTests if this user can createRegistrationTargets.booleancanCreateRegistrationTargetWithRecordTypes(Type[] registrationTargetRecordTypes) Tests if this user can create a singleRegistrationTarget using the desired record types.booleanTests if this user can deleteRegistrationTargets.booleanTests if this user can manageIdaliases forRegistrationTargets A return of true does not guarantee successful authorization.booleanTests if this user can updateRegistrationTargets.createRegistrationTarget(RegistrationTargetForm registrationTargetForm) Creates a newRegistrationTarget.voiddeleteRegistrationTarget(Id registrationTargetId) Deletes aRegistrationTarget.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getRegistrationTargetFormForCreate(Id courseOfferingId, Type[] registrationTargetRecordTypes) Gets the registration target form for creating new registration targets.getRegistrationTargetFormForUpdate(Id registrationTargetId) Gets the registration target form for updating an existing registration target.voidupdateRegistrationTarget(RegistrationTargetForm registrationTargetForm) Updates an existing registration target.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.
-
canCreateRegistrationTargets
boolean canCreateRegistrationTargets()Tests if this user can createRegistrationTargets. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRegistrationTarget will 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:
falseifRegistrationTargetcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRegistrationTargetWithRecordTypes
Tests if this user can create a singleRegistrationTarget using the desired record types. WhileCourseRegistrationManager.getRegistrationTargetRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRegistrationTarget. Providing an empty array tests if aRegistrationTarget can be created with no records.- Parameters:
registrationTargetRecordTypes- array of registration target record types- Returns:
trueifRegistrationTargetcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-registrationTargetRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRegistrationTargetFormForCreate
RegistrationTargetForm getRegistrationTargetFormForCreate(Id courseOfferingId, Type[] registrationTargetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration target form for creating new registration targets. A new form should be requested for each create transaction.- Parameters:
courseOfferingId- a course offeringIdregistrationTargetRecordTypes- array of registration target record types- Returns:
- the registration target form
- Throws:
NotFoundException-courseOfferingIdis not foundNullArgumentException-courseOfferingIdorregistrationTargetRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRegistrationTarget
RegistrationTarget createRegistrationTarget(RegistrationTargetForm registrationTargetForm) throws OperationFailedException, PermissionDeniedException Creates a newRegistrationTarget.- Parameters:
registrationTargetForm- the form for thisRegistrationTarget- Returns:
- the new
RegistrationTarget - Throws:
IllegalStateException-registrationTargetFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-registrationTargetFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-registrationTargetFormdid not originate fromgetRegistrationTargetFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRegistrationTargets
boolean canUpdateRegistrationTargets()Tests if this user can updateRegistrationTargets. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRegistrationTarget will 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:
falseifRegistrationTargetmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRegistrationTargetFormForUpdate
RegistrationTargetForm getRegistrationTargetFormForUpdate(Id registrationTargetId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the registration target form for updating an existing registration target. A new registration target form should be requested for each update transaction.- Parameters:
registrationTargetId- theIdof theRegistrationTarget- Returns:
- the registration target form
- Throws:
NotFoundException-registrationTargetIdis not foundNullArgumentException-registrationTargetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRegistrationTarget
void updateRegistrationTarget(RegistrationTargetForm registrationTargetForm) throws OperationFailedException, PermissionDeniedException Updates an existing registration target.- Parameters:
registrationTargetForm- the form containing the elements to be updated- Throws:
IllegalStateException-registrationTargetFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-registrationTargetFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-registrationTargetFormdid not originate fromgetRegistrationTargetFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRegistrationTargets
boolean canDeleteRegistrationTargets()Tests if this user can deleteRegistrationTargets. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRegistrationTarget will 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:
falseifRegistrationTargetdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRegistrationTarget
void deleteRegistrationTarget(Id registrationTargetId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRegistrationTarget.- Parameters:
registrationTargetId- theIdof theRegistrationTargetto remove- Throws:
NotFoundException-registrationTargetIdnot foundNullArgumentException-registrationTargetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRegistrationTargetAliases
boolean canManageRegistrationTargetAliases()Tests if this user can manageIdaliases forRegistrationTargets 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:
falseifRegistrationTargetaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRegistrationTarget
void aliasRegistrationTarget(Id registrationTargetId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRegistrationTarget for the purpose of creating compatibility. The primaryIdof theRegistrationTarget is determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another registration target, it is reassigned to the given registration targetId.- Parameters:
registrationTargetId- theIdof aRegistrationTargetaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-registrationTargetIdnot foundNullArgumentException-registrationTargetIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-