Interface DirectoryReceiver

All Superinterfaces:
OsidReceiver

public interface DirectoryReceiver extends OsidReceiver

The directory receiver is the consumer supplied interface for receiving notifications pertaining to new, updated or deleted directories.

An example showing how to receive notifications of new directories created under a user's home directory.

notificationSession = manager.getDirectoryNotificationSessionForDirectory(myReceiver, "/Users/tom");
notificationSession.useFederatedDirectoryView();
notificationSession.registerForNewDirectories();            
  
class myReceiver {
    void newDirectories(osid.id.IdList directoryIds) {
        while (directoryIds.hasNext()) {
           osid.filing.Directory directory = lookupSession.getDirectory(directoryIds.getNextId());
           print "new directory created: " + directory.getPath());
        }

        notificationSession.acknowledgeDiectoryNotification(notificationId);
    }

    void changedDirectories(osid.id.IdList directoryIds) {}
    void deletedDirectories(osid.id.IdList directoryIds) {}
    void up() {}
    void down() {}
}            
  
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    changedDirectories(Id notificationId, IdList directoryIds)
    The callback for notification of updated directories.
    void
    deletedDirectories(Id notificationId, IdList directoryIds)
    the callback for notification of deleted directories.
    void
    newDirectories(Id notificationId, IdList directoryIds)
    The callback for notifications of new directories.

    Methods inherited from interface OsidReceiver

    down, up
    Modifier and Type
    Method
    Description
    void
    The callback for notifications that the notification bus is not operating.
    void
    up()
    The callback for notifications that the notification bus is operational.
  • Method Details

    • newDirectories

      void newDirectories(Id notificationId, IdList directoryIds)
      The callback for notifications of new directories.
      Parameters:
      notificationId - the notification Id
      directoryIds - the Ids of the new directories
      Compliance:
      mandatory - This method must be implemented.
    • changedDirectories

      void changedDirectories(Id notificationId, IdList directoryIds)
      The callback for notification of updated directories.
      Parameters:
      notificationId - the notification Id
      directoryIds - the Ids of the new directories
      Compliance:
      mandatory - This method must be implemented.
    • deletedDirectories

      void deletedDirectories(Id notificationId, IdList directoryIds)
      the callback for notification of deleted directories.
      Parameters:
      notificationId - the notification Id
      directoryIds - the Ids of the new directories
      Compliance:
      mandatory - This method must be implemented.