Examples: CutoffDate, IsCutoffDelete, and CutoffInterval properties

This agent sets a cutoff date based on the agent comment.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      Agent agent = agentContext.getCurrentAgent();
      Database db = agentContext.getCurrentDatabase();
      Replication replication = db.getReplicationInfo();
      if (agent.getComment().equals("")) {
        replication.setCutoffDelete(false);
        System.out.println("No cutoff date"); }
      else {
        Integer i = new Integer(agent.getComment());
        replication.setCutoffDelete(true);
        replication.setCutoffInterval(i.longValue());
        System.out.println("Cutoff date is " + 
        replication.getCutoffDate()); }
      replication.save();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}