Package org.apache.james.mailbox.exception

Examples of org.apache.james.mailbox.exception.MailboxException


        public Iterator<Header> headers() throws MailboxException {
            if (headers == null) {
                try {
                    headers = ResultUtils.createHeaders(message);
                } catch (IOException e) {
                    throw new MailboxException("Unable to parse headers", e);
                }
            }
            return headers.iterator();
        }
View Full Code Here


                if (mListeners.contains(listener) == false) {
                    mListeners.add(listener);
                }       
            }
        } else {
            throw new MailboxException("Cannot add MailboxListener to null list");
        }
    }
View Full Code Here

        if (gListeners != null) {
            synchronized (gListeners) {
                gListeners.add(listener);
            }
        } else {
            throw new MailboxException("Cannot add MailboxListener to null list");
        }
    }
View Full Code Here

                        listeners.remove(mailboxPath);
                    }
                }
            }
        } else {
            throw new MailboxException("Cannot remove MailboxListener from null list");
        }
    }
View Full Code Here

        if (gListeners != null) {
            synchronized (gListeners) {
                gListeners.remove(listener);
            }
        } else {
            throw new MailboxException("Cannot remove MailboxListener from null list");
        }
    }
View Full Code Here

                    mimeDescriptor = MimeDescriptorImpl.build(getFullContent().getInputStream());
                } else {
                    mimeDescriptor = new LazyMimeDescriptor(this, message);
                }
            } catch (IOException e) {
                throw new MailboxException("Unable to create the MimeDescriptor", e);
            } catch (MimeException e) {
                throw new MailboxException("Unable to create the MimeDescriptor", e);
            }
        }
        return mimeDescriptor;
    }
View Full Code Here

            if (e instanceof RollbackException) {
                Throwable t = e.getCause();
                if (t != null && t instanceof EntityExistsException)
                    throw new MailboxExistsException(lastMailboxName);
            }
            throw new MailboxException("Commit of transaction failed", e);
        }
    }
View Full Code Here

    public void save(Mailbox<Long> mailbox) throws MailboxException {
        try {
            this.lastMailboxName = mailbox.getName();
            getEntityManager().persist(mailbox);
        } catch (PersistenceException e) {
            throw new MailboxException("Save of mailbox " + mailbox.getName() +" failed", e);
        }
    }
View Full Code Here

                return (JPAMailbox) getEntityManager().createNamedQuery("findMailboxByNameWithUser").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).setParameter("userParam", mailboxPath.getUser()).getSingleResult();
            }
        } catch (NoResultException e) {
            throw new MailboxNotFoundException(mailboxPath);
        } catch (PersistenceException e) {
            throw new MailboxException("Search of mailbox " + mailboxPath + " failed", e);
        }
    }
View Full Code Here

    public void delete(Mailbox<Long> mailbox) throws MailboxException {
        try
            getEntityManager().createNamedQuery("deleteMessages").setParameter("idParam", mailbox.getMailboxId()).executeUpdate();
            getEntityManager().remove(mailbox);
        } catch (PersistenceException e) {
            throw new MailboxException("Delete of mailbox " + mailbox + " failed", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.exception.MailboxException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.