次のエージェントは、現在のデータベースの作成時刻を出力します。
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();
DateTime createdDateTime = db.getCreated();
String sCreatedTime = createdDateTime.getTimeOnly();
System.out.println
("Database ¥"" + db.getTitle() +
"¥" was created at " + sCreatedTime + ".");
} catch(Exception e) {
e.printStackTrace();
}
}
}