Domino Code Fragment

Code Name*
Owner property
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.137.180.32
Description*
This example prints the name and common owner of all the agents in the current database.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;
import java.util.Vector;


public class owneragent extends AgentBase
{
 public void NotesMain()
   {
   try
     {
       Session s = getSession();
       AgentContext ac = s.getAgentContext();
       Database db = ac.getCurrentDatabase();
       Vector agents = db.getAgents();
       for (int i = 0; i < agents.size(); i++)
       {
         Agent agent = (Agent) agents.elementAt(i);
         System.out.println("Agent " + agent.getName() +
         "'s owner is " + agent.getOwner());
       }
     }
   catch (Exception e)
     {
       e.printStackTrace();
     }
   }
}