Search in sources :

Example 1 with GetIMAPRecentResponse

use of com.zimbra.soap.mail.message.GetIMAPRecentResponse in project zm-mailbox by Zimbra.

the class GetIMAPRecent method handle.

@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
    ZimbraSoapContext zsc = getZimbraSoapContext(context);
    Mailbox mbox = getRequestedMailbox(zsc);
    OperationContext octxt = getOperationContext(zsc, context);
    GetIMAPRecentRequest req = zsc.elementToJaxb(request);
    ItemIdentifier itemIdent = ItemIdentifier.fromOwnerAndRemoteId(mbox.getAccountId(), req.getId());
    if (!mbox.getAccountId().equals(itemIdent.accountId)) {
        throw MailServiceException.NO_SUCH_FOLDER(req.getId());
    }
    return zsc.jaxbToElement(new GetIMAPRecentResponse(mbox.getImapRecent(octxt, itemIdent.id)));
}
Also used : OperationContext(com.zimbra.cs.mailbox.OperationContext) GetIMAPRecentRequest(com.zimbra.soap.mail.message.GetIMAPRecentRequest) ItemIdentifier(com.zimbra.common.mailbox.ItemIdentifier) Mailbox(com.zimbra.cs.mailbox.Mailbox) GetIMAPRecentResponse(com.zimbra.soap.mail.message.GetIMAPRecentResponse) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext)

Aggregations

ItemIdentifier (com.zimbra.common.mailbox.ItemIdentifier)1 Mailbox (com.zimbra.cs.mailbox.Mailbox)1 OperationContext (com.zimbra.cs.mailbox.OperationContext)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 GetIMAPRecentRequest (com.zimbra.soap.mail.message.GetIMAPRecentRequest)1 GetIMAPRecentResponse (com.zimbra.soap.mail.message.GetIMAPRecentResponse)1