JAVA/CORBA クラス


例:createFTIndex メソッド
次のエージェントは、現在のデータベースに全文索引を作成、または再作成します。

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();
     int options = Database.FTINDEX_ALL_BREAKS +
       Database.FTINDEX_CASE_SENSITIVE;
     if (db.isFTIndexed())
     {
       db.createFTIndex(options, true);
       System.out.println("Database index recreated");
     }
     else
     {
       db.createFTIndex(options, false);
       System.out.println("New database index created");
     }

   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

関連項目