use of com.zimbra.cs.redolog.op.AlterItemTag in project zm-mailbox by Zimbra.
the class Mailbox method alterTag.
public void alterTag(OperationContext octxt, int[] itemIds, MailItem.Type type, Flag.FlagInfo finfo, boolean addTag, TargetConstraint tcon) throws ServiceException {
AlterItemTag redoRecorder = new AlterItemTag(mId, itemIds, type, finfo.flagName, addTag, tcon);
boolean success = false;
try {
beginTransaction("alterTag", octxt, redoRecorder);
setOperationTargetConstraint(tcon);
alterTag(itemIds, type, finfo.toFlag(this), addTag);
success = true;
} finally {
endTransaction(success);
}
}
use of com.zimbra.cs.redolog.op.AlterItemTag in project zm-mailbox by Zimbra.
the class Mailbox method alterTag.
public void alterTag(OperationContext octxt, int[] itemIds, MailItem.Type type, String tagName, boolean addTag, TargetConstraint tcon) throws ServiceException {
AlterItemTag redoRecorder = new AlterItemTag(mId, itemIds, type, tagName, addTag, tcon);
boolean success = false;
try {
beginTransaction("alterTag", octxt, redoRecorder);
setOperationTargetConstraint(tcon);
Tag tag;
try {
tag = getTagByName(tagName);
} catch (NoSuchItemException nsie) {
if (tagName.startsWith(Tag.FLAG_NAME_PREFIX)) {
throw nsie;
}
Tag.NormalizedTags ntags = new NormalizedTags(this, new String[] { tagName }, addTag, true);
if (ntags.getTags().length == 0) {
success = true;
return;
}
tag = getTagByName(ntags.getTags()[0]);
}
alterTag(itemIds, type, tag, addTag);
success = true;
} finally {
endTransaction(success);
}
}
Aggregations