Package org.apache.james.mailbox

Examples of org.apache.james.mailbox.MailboxException


        try {
            Session s = repository.login(mailboxSession);
            Node node = s.getNodeByIdentifier(mailbox.getMailboxId());
            return node.getProperty(JCRMailbox.LASTUID_PROPERTY).getLong();
        } catch (RepositoryException e) {
            throw new MailboxException("Unable to get last uid for mailbox " + mailbox, e);
        }
       
    }
View Full Code Here


            uid++;
            node.setProperty(JCRMailbox.LASTUID_PROPERTY, uid);
            s.save();
            return uid;
        } catch (RepositoryException e) {
            throw new MailboxException("Unable to consume next uid for mailbox " + mailbox, e);
        }
    }
View Full Code Here

            Map<Long, MessageMetaData> uids = new HashMap<Long, MessageMetaData>();
            uids.put(data.getUid(), data);
            dispatcher.added(mailboxSession, uids, getMailboxEntity());
            return data.getUid();
        } catch (IOException e) {
            throw new MailboxException("Unable to parse message", e);
        } catch (MimeException e) {
            throw new MailboxException("Unable to parse message", e);
        } catch (MailboxException e) {
            throw new MailboxException("Unable to parse message", e);
        } finally {
            IOUtils.closeQuietly(bIn);
            IOUtils.closeQuietly(tmpMsgIn);
            IOUtils.closeQuietly(out);
            IOUtils.closeQuietly(contentIn);
View Full Code Here

            Map<Long, MessageMetaData> copiedUids = copy(set, toMailbox, session);
            dispatcher.added(session, copiedUids, toMailbox.getMailboxEntity());

            return MessageRange.toRanges(new ArrayList<Long>(copiedUids.keySet()));
        } catch (MailboxException e) {
            throw new MailboxException("Unable to parse message", e);
        }
    }
View Full Code Here

                });
               copiedRows.add(data);
            }
            return copiedRows.iterator();
        } catch (MailboxException e) {
            throw new MailboxException("Unable to parse message", e);
        }
    }
View Full Code Here

                }
            });
            return copiedMessages;

        } catch (MailboxException e) {
            throw new MailboxException("Unable to parse message", e);
        }
    }
View Full Code Here

     */
    protected void begin() throws MailboxException {
        try {
            getEntityManager().getTransaction().begin();
        } catch (PersistenceException e) {
            throw new MailboxException("Begin of transaction failed", e);
        }
    }
View Full Code Here

     */
    protected void commit() throws MailboxException {
        try {
            getEntityManager().getTransaction().commit();
        } catch (PersistenceException e) {
            throw new MailboxException("Commit of transaction failed",e);
        }
    }
View Full Code Here

                }

            } while (results.size() > 0 && batchSize > 0);

        } catch (PersistenceException e) {
            throw new MailboxException("Search of MessageRange " + set + " failed in mailbox " + mailbox, e);
        }
    }
View Full Code Here

     */
    public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
        try {
            return (Long) getEntityManager().createNamedQuery("countMessagesInMailbox").setParameter("idParam", mailbox.getMailboxId()).getSingleResult();
        } catch (PersistenceException e) {
            throw new MailboxException("Count of messages failed in mailbox " + mailbox, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.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.