* org.apache.james.imap.api.ImapCommand,
* org.apache.james.imap.api.process.ImapProcessor.Responder)
*/
protected void doProcess(StatusRequest request, ImapSession session, String tag, ImapCommand command, Responder responder) {
final MailboxPath mailboxPath = buildFullPath(session, request.getMailboxName());
final StatusDataItems statusDataItems = request.getStatusDataItems();
final Logger logger = session.getLog();
final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
try {
if (logger != null && logger.isDebugEnabled()) {
logger.debug("Status called on mailbox named " + mailboxPath + " (" + mailboxPath + ")");
}
final MailboxManager mailboxManager = getMailboxManager();
final MessageManager mailbox = mailboxManager.getMailbox(mailboxPath, ImapSessionUtils.getMailboxSession(session));
final MessageManager.MetaData.FetchGroup fetchGroup;
if (statusDataItems.isUnseen()) {
fetchGroup = MessageManager.MetaData.FetchGroup.UNSEEN_COUNT;
} else {
fetchGroup = MessageManager.MetaData.FetchGroup.NO_UNSEEN;
}
final MessageManager.MetaData metaData = mailbox.getMetaData(false, mailboxSession, fetchGroup);