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);
}
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);
}
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));
}
}
}
Aggregations