JAVA/CORBA CLASSES


Examples: Type property
This agent gets the type of every database in the local directory.

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(null);
     Database db = dbdir.getFirstDatabase(DbDirectory.DATABASE);
     System.out.println("Local databases and types:");
     while (db != null) {
       db.open();
       System.out.println("\t" + db.getTitle() + " (" +
         db.getFileName() + ") " +
         getTypeString(db.getType()));
       db = dbdir.getNextDatabase();
     }
     
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
 
 String getTypeString(int type) {
   String typeString = null;
   switch (type) {
     case Database.DBTYPE_ADDR_BOOK:  
       typeString = "Address book"; break;
     case Database.DBTYPE_IMAP_SVR_PROXY:  
       typeString = "IMAP server proxy"; break;
     case Database.DBTYPE_LIBRARY:  
       typeString = "Library"; break;
     case Database.DBTYPE_LIGHT_ADDR_BOOK:  
       typeString = "Directory catalog (light address book)"; break;
     case Database.DBTYPE_MAILBOX:  
       typeString = "Mailbox"; break;
     case Database.DBTYPE_MAILFILE:
       typeString = "Mail file"; break;
     case Database.DBTYPE_MULTIDB_SRCH:
       typeString = "Multi-database search"; break;
     case Database.DBTYPE_NEWS_SVR_PROXY:
       typeString = "News server proxy"; break;
     case Database.DBTYPE_PERS_JOURNAL:
       typeString = "Personal journal"; break;
     case Database.DBTYPE_PORTFOLIO:
       typeString = "Portfolio"; break;
     case Database.DBTYPE_STANDARD:
       typeString = "Standard"; break;
     case Database.DBTYPE_SUBSCRIPTIONS:
       typeString = "Subscriptions"; break;
     case Database.DBTYPE_WEB_APP:
       typeString = "Web application";
   }
   return typeString;
 }
}

See Also