Examples: compactWithOptions method
- This agent compacts TooBig.nsf using the options b, L, and S10.
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 = session.getDatabase(null, "TooBig");
if (db.isOpen())
{
int delta = db.compactWithOptions("bLS10");
System.out.println("Size difference in bytes = " + delta);
}
else
System.out.println("Could not open database");
} catch(Exception e) {
e.printStackTrace();
}
}
}
- This agent compacts TooBig.nsf using the same options.
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 = session.getDatabase(null, "TooBig");
if (db.isOpen())
{
int options = Database.CMPC_RECOVER_REDUCE_INPLACE +
Database.CMPC_NO_LOCKOUT;
int delta = db.compactWithOptions(options, "10");
System.out.println("Size difference in bytes = " + delta);
}
else
System.out.println("Could not open database");
} catch(Exception e) {
e.printStackTrace();
}
}
}
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.