JAVA/CORBA CLASSES


Examples: openByReplicaID method
This agent attempts to open a replica of the current database on a particular server.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

 public void NotesMain() {

   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();

     // (Your code goes here)
     String id = agentContext.getCurrentDatabase().getReplicaID();
     String server = "Slapper/East/Acme";
     Database db = session.getDatabase(null, null);
     if (db.openByReplicaID(server, id))
     {
       System.out.println("Replica of current database on Slapper");
       System.out.println("Server = " + db.getServer());
       System.out.println("Filepath = " + db.getFilePath());
       System.out.println("Title = " + db.getTitle());
     }
     else
       System.out.println("No replica of current database on Slapper");

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

See Also