JAVA/CORBA CLASSES


Examples: Replication class
This agent prints the replication properties for the current database.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
 public void NotesMain() {
   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();
     // (Your code goes here)
     Database db = agentContext.getCurrentDatabase();
     Replication replication = db.getReplicationInfo();
     if (replication.isDisabled()
      System.out.println("Replication is disabled");
     else {
       System.out.println("Replication is enabled");
       String p = null;
       switch (replication.getPriority()) {
       case Replication.CNOTES_REPLCONST_PRIORITYHIGH :
         p = "high";
       case Replication.CNOTES_REPLCONST_PRIORITYLOW :
         p = "low";
       case Replication.CNOTES_REPLCONST_PRIORITYMED :
         p = "medium";
       case Replication.CNOTES_REPLCONST_PRIORITYNOTSET :
         p = "not set"; }
       System.out.println("Priority is " + p); }
    if (replication.isAbstract())
       System.out.println("Truncate large documents and
         remove attachments");
     else
       System.out.println
       ("Do not truncate large documents and keep
         attachments");
     if (replication.isCutoffDelete()) {
       System.out.println("Cutoff date is "
       + replication.getCutoffDate());
       System.out.println("Cutoff interval is " +
       replication.getCutoffInterval()); }
     else
       System.out.println("Cutoff delete not in effect");
  if (replication.isIgnoreDeletes())
       System.out.println("Do not replicate deletions");
     else
       System.out.println("Replicate deletions");
     if (replication.isIgnoreDestDeletes())
       System.out.println
       ("Do not replicate destination deletions");
     else
       System.out.println("Replicate destination deletions");
     
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also