Examples: Managers property (Database - Java)

This agent displays the number of managers in the current database and the name of each.

import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      String title = db.getTitle();
      Vector managers = db.getManagers();
      int size = managers.size();
      if (size == 1) {
        System.out.println("Database \"" +
        title + "\" has 1 manager"); }
      else {
        System.out.println("Database \"" +
        title + "\" has " + size + " managers"); }
      for (int i=0; i<size; i++) {
        String name = (String)managers.elementAt(i);
        System.out.println
        ("Manager # " + (i+1) + ": " + name);  }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}