public interface FileNotificationSession extends 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
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeFileNotification(Id notificationId)
Acknowledge a file notification.
|
boolean |
canRegisterForFileNotifications()
Tests if this user can register for
File notifications. |
Directory |
getDirectory()
Gets the
Directory associated with this session. |
Id |
getDirectoryId()
Gets the
Id of this directory. |
void |
registerForChangedFile(Id fileId)
Registers for notification of an updated file.
|
void |
registerForChangedFiles()
Registers for notification of updated files.
|
void |
registerForDeletedFile(Id fileId)
Registers for notification of a deleted file.
|
void |
registerForDeletedFiles()
Registers for notification of deleted files.
|
void |
registerForNewFiles()
Register for notifications of new files.
|
void |
reliableFileNotifications()
Reliable notifications are desired.
|
void |
unreliableFileNotifications()
Unreliable notifications are desired.
|
void |
useFederatedDirectoryView()
Federates the view for methods in this session.
|
void |
useIsolatedDirectoryView()
Isolates the view for methods in this session.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDirectoryId()
Id
of this directory. Id
of this directorymandatory
- This method must be implemented. Directory getDirectory() throws OperationFailedException, PermissionDeniedException
Directory
associated with this session. Directory
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canRegisterForFileNotifications()
File
notifications.
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 a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer notification
operations. false
if notification methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useFederatedDirectoryView()
mandatory
- This method is must be implemented. void useIsolatedDirectoryView()
mandatory
- This method is must be implemented. void reliableFileNotifications()
acknowledgeFileNotification()
.mandatory
- This method is must be implemented. void unreliableFileNotifications()
mandatory
- This method is must be implemented. void acknowledgeFileNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
notificationId
- the Id
of the notificationOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForNewFiles() throws OperationFailedException, PermissionDeniedException
FileReceiver.newFiles()
is invoked when a new File
is created.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedFiles() throws OperationFailedException, PermissionDeniedException
FileReceiver.changedFiles()
is invoked when a file is changed.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedFile(Id fileId) throws OperationFailedException, PermissionDeniedException
FileReceiver.changedFiles()
is invoked when the specified file
is changed.fileId
- the Id
of the fileNullArgumentException
- fileId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedFiles() throws OperationFailedException, PermissionDeniedException
FileReceiver.deletedFiles()
is invoked when a file is deleted.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedFile(Id fileId) throws OperationFailedException, PermissionDeniedException
FileReceiver.changedFiles()
is invoked when the specified file
is deleted.fileId
- the Id
of the fileNullArgumentException
- fileId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.