例: addCertifierToAddressBook method

次のエージェントは、AceOne 上の Domino ディレクトリに cert2.id の文書を追加します。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

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

      // (Your code goes here) 
      Registration reg = session.createRegistration();
      reg.setRegistrationServer("AceOne");
      reg.setStoreIDInAddressBook(true);
      if (reg.addCertifierToAddressBook(
        "d:¥¥NotesAdministrator¥¥cert2.id", // certifier file
        "AceHardware", // certifier password
        "", // location field
        "")) // comment field
        { System.out.println("Add certifier succeeded"); }
        else { System.out.println("Add certifier failed"); }

    } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}