use of com.zimbra.cs.redolog.MailboxIdConflictException in project zm-mailbox by Zimbra.
the class CreateMailbox method redo.
@Override
public void redo() throws Exception {
int opMboxId = getMailboxId();
Mailbox mbox = MailboxManager.getInstance().getMailboxByAccountId(mAccountId, false);
if (mbox == null) {
Account account = Provisioning.getInstance().get(AccountBy.id, mAccountId);
if (account == null) {
throw new RedoException("Account " + mAccountId + " does not exist", this);
}
mbox = MailboxManager.getInstance().createMailbox(getOperationContext(), account);
if (mbox == null) {
//something went really wrong
throw new RedoException("unable to create mailbox for accountId " + mAccountId, this);
}
}
int mboxId = mbox.getId();
if (opMboxId == mboxId) {
mLog.info("Mailbox " + opMboxId + " for account " + mAccountId + " already exists");
return;
} else {
throw new MailboxIdConflictException(mAccountId, opMboxId, mboxId, this);
}
}
Aggregations