例: IsCurrentAccessPublicWriter property

次のエージェントは、データベースのパブリック文書を書き込めるユーザーかどうかを調べます。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

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

      // (Your code goes here) 
      String server = "Server1/East/Acme";
      String path = "bob¥¥DatabaseJava";
      Database db = session.getDatabase(server, path);
      if (db.isOpen()) { //Database must be open
        if (db.isCurrentAccessPublicWriter())
          System.out.println("You are a public writer");
        else
          System.out.println("You are not a public writer");
      }
      else
        System.out.println("Could not open database");

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