Search in sources :

Example 1 with ItemActionRequest

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

the class ZMailbox method resetImapUid.

public ItemActionResponse resetImapUid(List<Integer> idList) throws ServiceException {
    String ids = Joiner.on(",").join(idList);
    ActionSelector action = ActionSelector.createForIdsAndOperation(ids, MailConstants.OP_RESET_IMAP_UID);
    ItemActionRequest req = new ItemActionRequest(action);
    return invokeJaxb(req);
}
Also used : ItemActionRequest(com.zimbra.soap.mail.message.ItemActionRequest) ActionSelector(com.zimbra.soap.mail.type.ActionSelector)

Example 2 with ItemActionRequest

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

the class ZMailbox method copyItemAction.

public ItemActionResponse copyItemAction(ItemIdentifier targetFolder, List<ItemIdentifier> idList) throws ServiceException {
    String ids = Joiner.on(',').join(idList);
    ActionSelector action = ActionSelector.createForIdsAndOperation(ids, MailConstants.OP_COPY);
    action.setFolder(targetFolder.toString(this.getAccountId()));
    action.setNewlyCreatedIds(true);
    ItemActionRequest req = new ItemActionRequest(action);
    return invokeJaxb(req);
}
Also used : ItemActionRequest(com.zimbra.soap.mail.message.ItemActionRequest) ActionSelector(com.zimbra.soap.mail.type.ActionSelector)

Example 3 with ItemActionRequest

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

the class ZMailbox method delete.

/**
 * Delete <tt>MailItem</tt>s with given ids.  If there is no <tt>MailItem</tt> for a given id, that id is ignored.
 *
 * @param octxt operation context or {@code null}
 * @param itemIds item ids
 * @param nonExistingItems If not null, This gets populated with the item IDs of nonExisting items
 */
@Override
public void delete(OpContext octxt, List<Integer> itemIds, List<Integer> nonExistingItems) throws ServiceException {
    String ids = Joiner.on(",").join(itemIds);
    ActionSelector action = ActionSelector.createForIdsAndOperation(ids, MailConstants.OP_HARD_DELETE);
    action.setNonExistentIds(true);
    ItemActionRequest req = new ItemActionRequest(action);
    ItemActionResponse resp = invokeJaxb(req);
    ActionResult ar = resp.getAction();
    for (String id : ar.getNonExistentIds().split(",")) {
        if (id.length() > 0) {
            nonExistingItems.add(Integer.parseInt(id));
        }
    }
}
Also used : ItemActionRequest(com.zimbra.soap.mail.message.ItemActionRequest) ActionResult(com.zimbra.soap.mail.type.ActionResult) ActionSelector(com.zimbra.soap.mail.type.ActionSelector) ItemActionResponse(com.zimbra.soap.mail.message.ItemActionResponse)

Aggregations

ItemActionRequest (com.zimbra.soap.mail.message.ItemActionRequest)3 ActionSelector (com.zimbra.soap.mail.type.ActionSelector)3 ItemActionResponse (com.zimbra.soap.mail.message.ItemActionResponse)1 ActionResult (com.zimbra.soap.mail.type.ActionResult)1