JAVA/CORBA CLASSES
Examples: LastFTIndexed property
1. This agent prints the last update date of the full-text index for the current database if it has an index.
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();
String title = db.getTitle();
if (db.isFTIndexed()) {
DateTime dt = db.getLastFTIndexed();
System.out.println("Database \"" + title +
"\" last full-text indexed on " +
dt.getDateOnly()); }
else
System.out.println("Database \"" + title +
"\" is not full-text indexed");
} catch(Exception e) {
e.printStackTrace();
}
}
}
2. This agent is the same as above but checks the return value of getLastFTIndexed for existence of the index, allowing for both local and remote implementations.
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();
String title = db.getTitle();
DateTime dt = db.getLastFTIndexed();
if (dt != null && dt.getLocalTime().length() > 0)
System.out.println("Database \"" + title +
"\" last full-text indexed on " +
dt.getDateOnly()); }
else
System.out.println("Database \"" + title +
"\" is not full-text indexed");
} catch(Exception e) {
e.printStackTrace();
}
}
}
Véase también
LastFTIndexed property
Glosario
¿Desea opinar sobre la Ayuda?
Ayuda sobre la Ayuda
Abrir la Ayuda en pantalla completa
Glosario
¿Desea opinar sobre la Ayuda?
Ayuda sobre la Ayuda
Abrir la Ayuda en pantalla completa