Interface EnrollmentCourseCatalogAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Enrollments to
CourseCatalogs. An Enrollment may appear in multiple
CourseCatalogs and removing the last reference to an
Enrollment is the equivalent of deleting it. Each CourseCatalog
may have its own authorizations governing who is allowed to operate on it.
Adding a reference of an Enrollment to another
CourseCatalog is not a copy operation (eg: does not change its Id
).
Like all OsidSessions,
EnrollmentCourseCatalogAssignmentSessions are dedicated to single
processing threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignEnrollmentToCatalog(Id enrollmentId, Id courseCatalogId) Adds an existingEnrollmentto aCourseCatalog.booleanTests if this user can alter enrollment/course catalog mappings.booleancanAssignEnrollmentToCourseCatalog(Id courseCatalogId) Tests if this user can alter enrollment/course catalog mappings.getAssignableCourseCatalogIds(Id courseCatalogId) Gets a list of course catalogs including and under the given course catalog node in which any enrollment can be assigned.getAssignableCourseCatalogIdsForEnrollment(Id courseCatalogId, Id enrollmentId) Gets a list of course catalogs including and under the given course catalog node in which a specific enrollment can be assigned.voidreassignEnrollmeentToCourseCatalog(Id enrollmentId, Id fromCourseCatalogId, Id toCourseCatalogId) Moves anEnrollmentfrom oneCourseCatalogto another.voidunassignEnrollmentFromCourseCatalog(Id enrollmentId, Id courseCatalogId) Removes anEnrollmentfrom aCourseCatalog.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
canAssignEnrollments
boolean canAssignEnrollments()Tests if this user can alter enrollment/course catalog mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignEnrollmentToCourseCatalog
Tests if this user can alter enrollment/course catalog mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Parameters:
courseCatalogId- theIdof theCourseCatalog- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-courseCatalogIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableCourseCatalogIds
Gets a list of course catalogs including and under the given course catalog node in which any enrollment can be assigned.- Parameters:
courseCatalogId- theIdof theCourseCatalog- Returns:
- list of assignable course catalog
Ids - Throws:
NullArgumentException-courseCatalogIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableCourseCatalogIdsForEnrollment
IdList getAssignableCourseCatalogIdsForEnrollment(Id courseCatalogId, Id enrollmentId) throws OperationFailedException Gets a list of course catalogs including and under the given course catalog node in which a specific enrollment can be assigned.- Parameters:
courseCatalogId- theIdof theCourseCatalogenrollmentId- theIdof theEnrollment- Returns:
- list of assignable course catalog
Ids - Throws:
NullArgumentException-courseCatalogIdorenrollmentIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignEnrollmentToCatalog
void assignEnrollmentToCatalog(Id enrollmentId, Id courseCatalogId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingEnrollmentto aCourseCatalog.- Parameters:
enrollmentId- theIdof theEnrollmentcourseCatalogId- theIdof theCourseCatalog- Throws:
AlreadyExistsException-enrollmentIdis already assigned tocourseCatalogIdNotFoundException-enrollmentIdorcourseCatalogIdnot foundNullArgumentException-enrollmentIdorcourseCatalogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignEnrollmentFromCourseCatalog
void unassignEnrollmentFromCourseCatalog(Id enrollmentId, Id courseCatalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anEnrollmentfrom aCourseCatalog.- Parameters:
enrollmentId- theIdof theEnrollmentcourseCatalogId- theIdof theCourseCatalog- Throws:
NotFoundException-enrollmentIdorcourseCatalogIdnot found orenrollmentIdnot assigned tocourseCatalogIdNullArgumentException-enrollmentIdorcourseCatalogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignEnrollmeentToCourseCatalog
void reassignEnrollmeentToCourseCatalog(Id enrollmentId, Id fromCourseCatalogId, Id toCourseCatalogId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anEnrollmentfrom oneCourseCatalogto another. Mappings to otherCourseCatalogsare unaffected.- Parameters:
enrollmentId- theIdof theEnrollmentfromCourseCatalogId- theIdof the currentCourseCatalogtoCourseCatalogId- theIdof the destinationCourseCatalog- Throws:
AlreadyExistsException-enrollmentIdalready assigned totoCourseCatalogIdNotFoundException-enrollmentId, fromCourseCatalogId, ortoCourseCatalogIdnot found orenrollmentId, not mapped tofromCourseCatalogIdNullArgumentException-enrollmentId, fromCourseCatalogId, ortoCourseCatalogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-