例: IsAdminNames property

次のエージェントは、現在のデータベースの IsAdminNames を切り替えます。

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();
      ACL acl = db.getACL();
      if (acl.getAdministrationServer().equals(""))
        System.out.println("No admin server - can't change");
      else {
        acl.setAdminNames(!acl.isAdminNames());
        acl.save();
        System.out.println("IsAdminNames = " + acl.isAdminNames());
      }

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