JAVA/CORBA CLASSES
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) Agent agent = agentContext.getCurrentAgent(); String dbName = agent.getComment(); Database db = session.getDatabase(null, dbName); String title = db.getTitle(); double percentUsed = db.getPercentUsed(); if (percentUsed < 75) { int saved = db.compact(); System.out.println("Compacting database \"" + title + "\""); } System.out.println ("Database \"" + title + "\" is " + (int)percentUsed + " percent used"); } catch(Exception e) { e.printStackTrace(); } } }
See Also