use of com.zimbra.cs.mailbox.MailServiceException in project zm-mailbox by Zimbra.
the class CreateMountpoint method redo.
@Override
public void redo() throws Exception {
int mboxId = getMailboxId();
Mailbox mailbox = MailboxManager.getInstance().getMailboxById(mboxId);
try {
mailbox.createMountpoint(getOperationContext(), mFolderId, mName, mOwnerId, mRemoteId, mRemoteUuid, defaultView, mFlags, Color.fromMetadata(mColor), mReminderEnabled);
} catch (MailServiceException e) {
if (e.getCode() == MailServiceException.ALREADY_EXISTS) {
if (mLog.isInfoEnabled()) {
mLog.info("Mount " + mId + " already exists in mailbox " + mboxId);
}
} else {
throw e;
}
}
}
use of com.zimbra.cs.mailbox.MailServiceException in project zm-mailbox by Zimbra.
the class CreateSavedSearch method redo.
@Override
public void redo() throws Exception {
int mboxId = getMailboxId();
Mailbox mailbox = MailboxManager.getInstance().getMailboxById(mboxId);
try {
mailbox.createSearchFolder(getOperationContext(), mFolderId, mName, mQuery, mTypes, mSort, mFlags, Color.fromMetadata(mColor));
} catch (MailServiceException e) {
String code = e.getCode();
if (code.equals(MailServiceException.ALREADY_EXISTS)) {
if (mLog.isInfoEnabled())
mLog.info("Search " + mSearchId + " already exists in mailbox " + mboxId);
} else
throw e;
}
}
use of com.zimbra.cs.mailbox.MailServiceException in project zm-mailbox by Zimbra.
the class CreateTag method redo.
@Override
public void redo() throws Exception {
int mboxId = getMailboxId();
Mailbox mbox = MailboxManager.getInstance().getMailboxById(mboxId);
try {
mbox.createTag(getOperationContext(), mName, Color.fromMetadata(mColor));
} catch (MailServiceException e) {
String code = e.getCode();
if (code.equals(MailServiceException.ALREADY_EXISTS)) {
if (mLog.isInfoEnabled())
mLog.info("Tag " + mTagId + " already exists in mailbox " + mboxId);
} else {
throw e;
}
}
}
use of com.zimbra.cs.mailbox.MailServiceException in project zm-mailbox by Zimbra.
the class CreateChat method redo.
@Override
public void redo() throws Exception {
int mboxId = getMailboxId();
Mailbox mbox = MailboxManager.getInstance().getMailboxById(mboxId);
ParsedMessage pm = new ParsedMessage(getMessageBody(), getTimestamp(), mbox.attachmentsIndexingEnabled());
try {
mbox.createChat(getOperationContext(), pm, getFolderId(), getFlags(), getTags());
} catch (MailServiceException e) {
if (e.getCode() == MailServiceException.ALREADY_EXISTS) {
mLog.info("Chat " + getMessageId() + " is already in mailbox " + mboxId);
return;
} else {
throw e;
}
}
}
use of com.zimbra.cs.mailbox.MailServiceException in project zm-mailbox by Zimbra.
the class CreateFolderPath method redo.
@Override
public void redo() throws Exception {
int mboxId = getMailboxId();
Mailbox mailbox = MailboxManager.getInstance().getMailboxById(mboxId);
Folder.FolderOptions fopt = new Folder.FolderOptions();
fopt.setAttributes(attrs).setColor(Color.fromMetadata(color)).setDate(date);
fopt.setDefaultView(defaultView).setFlags(flags).setUrl(url).setCustomMetadata(custom);
try {
mailbox.createFolder(getOperationContext(), path, fopt);
} catch (MailServiceException e) {
String code = e.getCode();
if (code.equals(MailServiceException.ALREADY_EXISTS)) {
mLog.info("Folder %s already exists in mailbox %d", path, mboxId);
} else {
throw e;
}
}
}
Aggregations