Examples: fixup method

This agent runs the Fixup task on all the databases in the local directory.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

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

      // (Your code goes here) 
      DbDirectory dbdir = session.getDbDirectory(null);
      int options = Database.FIXUP_QUICK +
        Database.FIXUP_INCREMENTAL + Database.FIXUP_NOVIEWS;
      Database db = dbdir.getFirstDatabase(DbDirectory.DATABASE);
      while (db != null)
      {
        db.open();
        db.fixup(options);
        db = dbdir.getNextDatabase();
      }

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