Package org.apache.james.mailbox.exception

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


                UpdatedFlags uFlags = new UpdatedFlags(member.getUid(), member.getModSeq(), originalFlags, newFlags);
                updatedFlags.add(uFlags);
            }
        } catch (IOException e) {
            throw new MailboxException("Error setting flags for messages in " + mailbox, e);
        } finally {
            if (messages != null) {
                try {
                    messages.close();
                } catch (IOException e) {
                    throw new MailboxException("Error setting flags for messages in " + mailbox, e);
                }
            }
        }

        return updatedFlags.iterator();
View Full Code Here


            out.close();
            // increase the message count for the current mailbox
            mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, 1);
            return new SimpleMessageMetaData(message);
        } catch (IOException ex) {
            throw new MailboxException("Error setting flags for messages in " + mailbox, ex);
        } finally {
            if (messages != null) {
                try {
                    messages.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + messages, ex);
                }
            }
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing Inputtream", ex);
                }
            }
            if (out != null) {
                try {
                    out.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing OutputStream", ex);
                }
            }
        }
    }
View Full Code Here

            if (result == null) {
                throw new MailboxNotFoundException(mailboxPath);
            }
            return mailboxFromResult(result);
        } catch (IOException e) {
            throw new MailboxException("Search of mailbox " + mailboxPath + " failed", e);
        } finally {
            scanner.close();
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

            for (Result result : scanner) {
                mailboxList.add(mailboxFromResult(result));
            }
            return mailboxList;
        } catch (IOException e) {
            throw new MailboxException("Search of mailbox " + mailboxPath + " failed", e);
        } finally {
            scanner.close();
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

                Mailbox<UUID> mlbx = mailboxFromResult(result);
                mailboxList.add(mlbx);
            }
            return mailboxList;
        } catch (IOException ex) {
            throw new MailboxException("HBase IOException in list()", ex);
        } finally {
            scanner.close();
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

             * cast to HBaseMailbox to access lastuid and ModSeq
             */
            Put put = toPut((HBaseMailbox) mlbx);
            mailboxes.put(put);
        } catch (IOException ex) {
            throw new MailboxException("IOExeption", ex);
        } finally {
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

            mailboxes = new HTable(conf, MAILBOXES_TABLE);
            //TODO: delete all maessages from this mailbox
            Delete delete = new Delete(mailboxRowKey(mlbx.getMailboxId()));
            mailboxes.delete(delete);
        } catch (IOException ex) {
            throw new MailboxException("IOException in HBase cluster during delete()", ex);
        } finally {
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

            } catch (IOException e) {
                throw new MailboxNotFoundException("hasChildren() " + mailbox.getName());
            }
            return false;
        } catch (IOException e) {
            throw new MailboxException("Search of mailbox " + mailbox + " failed", e);
        } finally {
            scanner.close();
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

            get.addColumn(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ);
            get.setMaxVersions(1);
            Result result = mailboxes.get(get);

            if (result == null) {
                throw new MailboxException("Row or column not found!");
            }
            long modSeq = Bytes.toLong(result.getValue(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ));
            return modSeq;
        } catch (IOException e) {
            throw new MailboxException("highestModSeq", e);
        } finally {
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
View Full Code Here

        try {
            mailboxes = new HTable(conf, MAILBOXES_TABLE);
            long newValue = mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
            return newValue;
        } catch (IOException e) {
            throw new MailboxException("lastUid", e);
        } finally {
            if (mailboxes != null) {
                try {
                    mailboxes.close();
                } catch (IOException ex) {
                    throw new MailboxException("Error closing table " + mailboxes, ex);
                }
            }
        }
    }
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.