Examples: openDatabaseByReplicaID method

This agent attempts to open the help database, which is known to have the specified replica ID.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      DbDirectory dir = session.getDbDirectory(null);
      String rid = "852565D2000B5144";
      Database db = dir.openDatabaseByReplicaID(rid);
      if (db != null)
        System.out.println("help located and opened");
      else
        System.out.println("help not found");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}