UntilTime (NotesCalendar - Java)

Read-only. Specifies the time of the last invitation processed by getNewInvitations.

Defined in

NotesCalendar

Syntax

DateTime NotesCalendar.getUntilTime()
	throws NotesException

Usage

This property is set by getNewInvitations. It can be used as the second parameter to getNewInvitations to get invitations posted since the last call.

Examples

This agent gets calendar invitations for messages starting on January 1, 2012 three times, 30 minutes apart. The first call gets invitations since yesterday at 2:00 AM. The next two calls get invitations since the last one processed.
import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

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

          // (Your code goes here)
          DbDirectory dbdir = session.getDbDirectory("");
          Database maildb = dbdir.openMailDatabase();
          NotesCalendar cal = session.getCalendar(maildb);
          java.util.Calendar jdt = java.util.Calendar.getInstance();
          jdt.set(2012, 1, 1, 1, 1, 1);
          DateTime dt1 = session.createDateTime(jdt);
          DateTime dt2 = session.createDateTime("Yesterday 02");
          java.util.Vector invites = cal.getNewInvitations(dt1, dt2);
          Database db = agentContext.getCurrentDatabase();
          for (int j = 0; j < 3; j++) {
          // Create document to post results
          Document doc = db.createDocument();
          doc.appendItemValue("Form", "main");
          doc.appendItemValue("subject", "New invitations");
          RichTextItem body = doc.createRichTextItem("body");
          if (invites.size() == 0) body.appendText("No invitations");
          else {
        	  for (int i = 0; i < invites.size(); i++) {
        		  NotesCalendarNotice cale = (NotesCalendarNotice)invites.elementAt(i);
        		  body.appendText(cale.read());
        		  cale.recycle();
        		  body.addNewLine();
        	  }
          }
          doc.save(true, true);
          java.util.concurrent.TimeUnit.MINUTES.sleep(30);
          invites = cal.getNewInvitations(dt1, cal.getUntilTime());
          }
          
      } catch(Exception e) {
          e.printStackTrace();
      }
   }
}