use of com.zimbra.cs.redolog.op.PurgeImapDeleted in project zm-mailbox by Zimbra.
the class Mailbox method purgeImapDeleted.
public void purgeImapDeleted(OperationContext octxt) throws ServiceException {
PurgeImapDeleted redoRecorder = new PurgeImapDeleted(mId);
boolean success = false;
try {
beginTransaction("purgeImapDeleted", octxt, redoRecorder);
Set<Folder> purgeable = getAccessibleFolders((short) (ACL.RIGHT_READ | ACL.RIGHT_DELETE));
// short-circuit the DB call if we're tracking \Deleted counts and they're all 0
boolean skipDB = false;
if (getVersion().atLeast(1, 9)) {
int deleted = 0;
for (Folder folder : purgeable != null ? purgeable : listAllFolders()) {
deleted += folder.getDeletedCount();
}
skipDB = deleted == 0;
}
if (!skipDB) {
PendingDelete info = DbTag.getImapDeleted(this, purgeable);
MailItem.delete(this, info, null, true, false);
}
success = true;
} finally {
endTransaction(success);
}
}
Aggregations