JAVA/CORBA クラス


例:CutoffDate プロパティ、IsCutoffDelete プロパティ、CutoffInterval プロパティ
次のエージェントは、エージェントのコメントに基づいて切り離し日を設定します。

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();
   }
 }
}

関連項目