Search in sources :

Example 1 with GetIMAPRecentCutoffRequest

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

the class GetIMAPRecentCutoff 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);
    GetIMAPRecentCutoffRequest 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 GetIMAPRecentCutoffResponse(mbox.getImapRecentCutoff(octxt, itemIdent.id)));
}
Also used : OperationContext(com.zimbra.cs.mailbox.OperationContext) GetIMAPRecentCutoffRequest(com.zimbra.soap.mail.message.GetIMAPRecentCutoffRequest) ItemIdentifier(com.zimbra.common.mailbox.ItemIdentifier) GetIMAPRecentCutoffResponse(com.zimbra.soap.mail.message.GetIMAPRecentCutoffResponse) Mailbox(com.zimbra.cs.mailbox.Mailbox) 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 GetIMAPRecentCutoffRequest (com.zimbra.soap.mail.message.GetIMAPRecentCutoffRequest)1 GetIMAPRecentCutoffResponse (com.zimbra.soap.mail.message.GetIMAPRecentCutoffResponse)1