@Override public void removeMaxStorage(QuotaRoot quotaRoot) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Test public void testMailboxExceptionCause() { MailboxException mbe = new MailboxException(EXCEPTION_MESSAGE, EXCEPTION_CAUSE); assertThat(mbe).hasMessage(EXCEPTION_MESSAGE).hasCauseExactlyInstanceOf(Exception.class); assertThat(mbe.getCause()).hasMessage(CAUSE_MESSAGE); }
@Override public void done(boolean success) throws MailQueueException { mailQueueItem.done(success); if (success && mandatoryJmapMetaDataIsPresent()) { MessageId messageId = messageIdFactory.fromString((String) getMail().getAttribute(MailMetadata.MAIL_METADATA_MESSAGE_ID_ATTRIBUTE)); String username = (String) getMail().getAttribute(MailMetadata.MAIL_METADATA_USERNAME_ATTRIBUTE); if (getMail().getAttribute(IS_DELIVERED) == null) { try { MailboxSession mailboxSession = mailboxManager.createSystemSession(username); moveFromOutboxToSentWithSeenFlag(messageId, mailboxSession); getMail().setAttribute(IS_DELIVERED, IS_DELIVERED); } catch (MailShouldBeInOutboxException e) { LOG.info("Message does not exist on Outbox anymore, it could have already been sent", e); } catch (MailboxException e) { throw new MailQueueException(e.getMessage(), e); } } } }
@Override public void setGlobalMaxMessage(QuotaCount globalMaxMessageCount) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public Task reIndex(MailboxPath path, MessageUid uid) throws MailboxException { throw new MailboxException("Not implemented"); } }
@Override public void removeMaxMessage(QuotaRoot quotaRoot) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void removeDomainMaxMessage(Domain domain) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void removeDomainMaxStorage(Domain domain) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void setGlobalMaxStorage(QuotaSize globalMaxStorage) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void removeGlobalMaxStorage() throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void removeGlobalMaxMessage() throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public Task reIndex(MailboxPath path) throws MailboxException { throw new MailboxException("Not implemented"); }
@Override public Task reIndex(User user) throws MailboxException { throw new MailboxException("Not implemented"); }
@Override public Task reIndex() throws MailboxException { throw new MailboxException("Not implemented"); }
@Override public void setMaxMessage(QuotaRoot quotaRoot, QuotaCount maxMessageCount) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void setDomainMaxMessage(Domain domain, QuotaCount count) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void setDomainMaxStorage(Domain domain, QuotaSize size) throws MailboxException { throw new MailboxException("Operation is not supported"); }
@Override public void setMaxStorage(QuotaRoot quotaRoot, QuotaSize maxStorageQuota) throws MailboxException { throw new MailboxException("Operation is not supported"); }
public List<String> toParts(String serializedQuotaRoot) throws MailboxException { List<String> parts = Splitter.on(SEPARATOR).splitToList(serializedQuotaRoot); if (parts.size() != 2) { throw new MailboxException(serializedQuotaRoot + " used as QuotaRoot should contain exactly one \"" + SEPARATOR + "\""); } return parts; } }
@Override public void register(MailboxPath path) throws MailboxException { int count = 0; boolean success = false; while (count < maxRetry && !success) { count++; success = tryRegister(path); } if (!success) { throw new MailboxException(maxRetry + " reached while trying to register " + path); } }