Examples: SizeWarning property (Database - Java)

  1. This agent displays the size quota and warning for the current database.
    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();
          System.out.println("Size quota = " + db.getSizeQuota());
          System.out.println("Size warning = " + db.getSizeWarning());
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }
  2. This agent removes the size quota and warning for the current database.
    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();
          db.setSizeQuota(0);
          db.setSizeWarning(0);
          System.out.println("Size quota = " + db.getSizeQuota());
          System.out.println("Size warning = " + db.getSizeWarning());
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }