private void showNotAccessedInNDays(Vector vector, Document document) { int i = getPropertyAsInteger(pNotAccessedN); if (i > 0) { Vector vector1 = new Vector(); GregorianCalendar gregoriancalendar = new GregorianCalendar(); gregoriancalendar.setTime(new Date()); gregoriancalendar.add(6, -i); Date date = gregoriancalendar.getTime(); for (int j = 0; j < vector.size(); j++) { Map map = (Map) vector.elementAt(j); Date date1 = (Date) map.get("JavaLastLogoffTime"); if (date1 == null || date1.getTime() >= date.getTime()) { continue; } Vector vector2 = new Vector(); vector1.addElement(vector2); vector2.addElement(new Pair("Mailbox", map.get("MailboxDisplayName"))); synchronized (mDisplayDateFormat) { vector2.addElement(new Pair("Last Logoff Time", mDisplayDateFormat.format(date1))); } } addListContent(vector1, "Mailboxes Not Accessed in " + i + " Days", document); } }
/** CAUTION: Decompiled by hand. */ protected boolean update() { try { String s = "SELECT * FROM Exchange_Mailbox"; Vector vector = executeQuery(s); if (vector == null) { return false; } for (int i = 0; i < vector.size(); i++) { Map map = (Map) vector.elementAt(i); Date date = WMIUtils.makeJavaDateFromWMIDate((String) map.get("LastLogonTime")); if (date != null) { map.put("JavaLastLogonTime", date); } date = WMIUtils.makeJavaDateFromWMIDate((String) map.get("LastLogoffTime")); if (date != null) { map.put("JavaLastLogoffTime", date); } } Document document = createNewDocument("Exchange Mailbox Statistics"); showNotAccessedInNDays(vector, document); showOverLimitMailboxes(vector, document); showTopNMailboxesInSize(vector, document); saveDocument(document); setProperty(pStateString, "OK"); setProperty(pStatus, "OK"); return true; } catch (Exception e) { setProperty(pNoData, "n/a"); setProperty(pStatus, "error"); setProperty(pStateString, e.getMessage()); return false; } }
private void showOverLimitMailboxes(Vector vector, Document document) { Vector vector1 = new Vector(); for (int i = 0; i < vector.size(); i++) { Map map = (Map) vector.elementAt(i); String s = (String) map.get("StorageLimitInfo"); if (s.equals(EXCH_ISSUE_WARNING) || s.equals(EXCH_PROHIBIT_SEND)) { Vector vector2 = new Vector(); vector1.addElement(vector2); vector2.addElement(new Pair("Mailbox", map.get("MailboxDisplayName"))); } } addListContent(vector1, "Over Limit Mailboxes", document); }