Interface GradeNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Grades in this Gradebook. This also includes existing
grades that may appear or disappear due to changes in the Gradebook
hiera rchy, This session is intended for consumers needing to synchronize
their state with this service without the use of polling. Notifications
are cancelled when this session is closed.
The two views defined in this session correspond to the views in the GradeLookupSession.
Like all OsidSessions, GradeNotificationSessions are
dedicated to single processing threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeGradeNotification(Id notificationId) Acknowledge a grade notification.booleanTests if this user can register forGradenotifications.Gets theGradebookassociated with this session.Gets theGradebookIdassociated with this session.voidregisterForChangedGrade(Id gradeId) Register for notifications of an updated grade.voidRegister for notifications of updated grades.voidregisterForChangedGradesForGradeSystem(Id gradeSystemId) Register for notifications of updated grades for the given grade system.voidregisterForDeletedGrade(Id gradeId) Registers for notification of a deleted grade.voidRegisters for notification of deleted grades.voidregisterForDeletedGradesForGradeSystem(Id gradeSystemId) Register for notifications of deleted grades for the given grade system.voidRegister for notifications of new grades.voidregisterForNewGradesForGradeSystem(Id gradeSystemId) Register for notifications of new grades for the given grade system.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
getGradebookId
Id getGradebookId()Gets theGradebookIdassociated with this session.- Returns:
- the
Gradebook Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getGradebook
Gets theGradebookassociated with this session.- Returns:
- the gradebook
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForGradeNotifications
boolean canRegisterForGradeNotifications()Tests if this user can register forGradenotifications. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED.This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useFederatedGradebookView
void useFederatedGradebookView()Federates the view for methods in this session. A federated view will include grades in gradebooks which are children of this gradebook in the gradebook hierarchy.- Compliance:
mandatory- This method must be implemented.
-
useIsolatedGradebookView
void useIsolatedGradebookView()Isolates the view for methods in this session. An isolated view restricts notifications to this gradebook only.- Compliance:
mandatory- This method must be implemented.
-
reliableGradeNotifications
void reliableGradeNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeGradeNotification().- Compliance:
mandatory- This method must be implemented.
-
unreliableGradeNotifications
void unreliableGradeNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method must be implemented.
-
acknowledgeGradeNotification
void acknowledgeGradeNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a grade notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewGrades
Register for notifications of new grades.GradeReceiver.newGrades()is invoked when a newGradeappears in this gradebook.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewGradesForGradeSystem
void registerForNewGradesForGradeSystem(Id gradeSystemId) throws OperationFailedException, PermissionDeniedException Register for notifications of new grades for the given grade system.GradeReceiver.newGrades()is invoked when a newGradeappears in this gradebook.- Parameters:
gradeSystemId- theIdof theGradeSystemto monitor- Throws:
NullArgumentException-gradeSystemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedGrades
Register for notifications of updated grades.GradeReceiver.changedGrades()is invoked when aGradein this gradebook is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedGradesForGradeSystem
void registerForChangedGradesForGradeSystem(Id gradeSystemId) throws OperationFailedException, PermissionDeniedException Register for notifications of updated grades for the given grade system.GradeReceiver.changedGrades()is invoked when aGradein this gradebook is changed.- Parameters:
gradeSystemId- theIdof theGradeSystemto monitor- Throws:
NullArgumentException-gradeSystemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedGrade
Register for notifications of an updated grade.GradeReceiver.changedGrades()is invoked when the specifiedGradein this gradebook is changed.- Parameters:
gradeId- theIdof theGradeto monitor- Throws:
NullArgumentException-gradeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedGrades
Registers for notification of deleted grades.GradeReceiver.deletedGrades()is invoked when a grade is deleted or removed from this gradebook.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedGradesForGradeSystem
void registerForDeletedGradesForGradeSystem(Id gradeSystemId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted grades for the given grade system.GradeReceiver.deletedGrades()is invoked when aGradein this gradebook is deleted or removed.- Parameters:
gradeSystemId- theIdof theGradeSystemto monitor- Throws:
NullArgumentException-gradeSystemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedGrade
Registers for notification of a deleted grade.GradeReceiver.deletedGrades()is invoked when the specified grade is deleted or removed from this gradebook.- Parameters:
gradeId- theIdof theGradeto monitor- Throws:
NullArgumentException-gradeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-