Listening for email and triggering notifications

Messaging,Lab

Exercise

 

Write an application that registers a custom notification and a folder listener. The folder listener will activate the custom notification when an email arrives with a particular string in the subject of the email.

 

Objectives

·       Discover how to make an application auto-start

·       Discover how to register a folder listener

·       Discover how to register a custom notification

·       Discover how to monitor incoming email

 

Setup

  • Open Listen_1.zip
  • In the IDE, open the FolderListenerApp.jdw workspace
  • Open the MessageNotification.java source file.
  • Open the FolderListenerApp.java source file.

Tasks

  1. FolderListener Changes:
  2. Register the custom notification with the system
  3. Add a FolderListener to the store after it is retrieved
  4. Determine if the incoming message has been added to the INBOX folder
  5. Retrieve the subject of the new message
  6. Trigger the notification once it is discovered that the subject contains the string “< TAG >”.
  7. MessageNotification Changes:
  8. Register the consequence manager