Interface FileNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Files . 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.
Two view are defined in this session:
federated view: includes notifications of files located in subdirectories in this directory
isolated view: includes notifcations of files in this directory only
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeFileNotification(Id notificationId) Acknowledge a file notification.booleanTests if this user can register forFilenotifications.Gets theDirectoryassociated with this session.Gets theIdof this directory.voidregisterForChangedFile(Id fileId) Registers for notification of an updated file.voidRegisters for notification of updated files.voidregisterForDeletedFile(Id fileId) Registers for notification of a deleted file.voidRegisters for notification of deleted files.voidRegister for notifications of new files.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, 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
-
getDirectoryId
Id getDirectoryId()Gets theIdof this directory.- Returns:
- the
Idof this directory - Compliance:
mandatory- This method must be implemented.
-
getDirectory
Gets theDirectoryassociated with this session.- Returns:
- the
Directoryassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForFileNotifications
boolean canRegisterForFileNotifications()Tests if this user can register forFilenotifications. 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.
-
useFederatedDirectoryView
void useFederatedDirectoryView()Federates the view for methods in this session. A federated view will include files in directories which are children of this directory.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedDirectoryView
void useIsolatedDirectoryView()Isolates the view for methods in this session. An isolated view restricts notifications to this diretory only.- Compliance:
mandatory- This method is must be implemented.
-
reliableFileNotifications
void reliableFileNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeFileNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableFileNotifications
void unreliableFileNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeFileNotification
void acknowledgeFileNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a file notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewFiles
Register for notifications of new files.FileReceiver.newFiles()is invoked when a newFileis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedFiles
Registers for notification of updated files.FileReceiver.changedFiles()is invoked when a file is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedFile
Registers for notification of an updated file.FileReceiver.changedFiles()is invoked when the specified file is changed.- Parameters:
fileId- theIdof the file- Throws:
NullArgumentException-fileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedFiles
Registers for notification of deleted files.FileReceiver.deletedFiles()is invoked when a file is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedFile
Registers for notification of a deleted file.FileReceiver.changedFiles()is invoked when the specified file is deleted.- Parameters:
fileId- theIdof the file- Throws:
NullArgumentException-fileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-