Examples: IsNotesAgent and IsWebAgent properties
This agent prints whether each agent in a database is a Notes® agent and/or a Web agent.
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)
Database db = agentContext.getCurrentDatabase();
Vector agents = db.getAgents();
System.out.println("Agents in database:");
Enumeration e = db.getAgents().elements();
while (e.hasMoreElements()) {
Agent agent = (Agent)e.nextElement();
System.out.println(agent.getName());
if (agent.isNotesAgent())
System.out.println(" is a Notes agent");
else
System.out.println(" is not a Notes agent");
if (agent.isWebAgent())
System.out.println(" is a Web agent");
else
System.out.println(" is not a Web agent");
}
} catch(Exception e) {
e.printStackTrace();
}
}
}