Examples: getAllUnreadDocuments method

This agent prints a message saying how many documents in the database have not yet been read.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      
      DocumentCollection dc = db.getAllUnreadDocuments();
      System.out.println("This database contains "
            + dc.getCount() + " unread documents.");
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}