Examples: IsPrivateAddressBook property
This agent uses getAddressBooks in Session to retrieve the user Domino® Directories and Personal Address Books, and prints a message for each one that is a Personal Address Book.
import lotus.domino.*;
import java.util.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
System.out.println("Personal address books:\n");
Vector books = session.getAddressBooks();
Enumeration e = books.elements();
Database db;
while (e.hasMoreElements()) {
db = (Database)e.nextElement();
if (db.isPrivateAddressBook()) {
String msg = " " + db.getFilePath();
if (db.getServer() != "")
msg = msg + " on " + db.getServer();
System.out.println(msg); }}
} catch(Exception e) {
e.printStackTrace();
}
}
}