Examples of MailboxManager


Examples of org.apache.james.mailbox.MailboxManager

        try {
            if (logger != null && logger.isDebugEnabled()) {
                logger.debug("Status called on mailbox named " + mailboxPath);
            }

            final MailboxManager mailboxManager = getMailboxManager();
            final MessageManager mailbox = mailboxManager.getMailbox(mailboxPath, ImapSessionUtils.getMailboxSession(session));
            final MessageManager.MetaData.FetchGroup fetchGroup;
            if (statusDataItems.isUnseen()) {
                fetchGroup = MessageManager.MetaData.FetchGroup.UNSEEN_COUNT;
            } else {
                fetchGroup = MessageManager.MetaData.FetchGroup.NO_UNSEEN;
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

    }

    @Override
    protected void doProcess(GetACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) {

        final MailboxManager mailboxManager = getMailboxManager();
        final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
        final String mailboxName = message.getMailboxName();
        try {

            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);

            /*
             * RFC 4314 section 6.
             * An implementation MUST make sure the ACL commands themselves do
             * not give information about mailboxes with appropriately
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

        }
    }
   
    private MessageManager getMailbox(final ImapSession session, final SelectedMailbox selected) throws MailboxException {
        final MailboxManager mailboxManager = getMailboxManager();
        final MessageManager mailbox = mailboxManager.getMailbox(selected.getPath(), ImapSessionUtils.getMailboxSession(session));
        return mailbox;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

        MessageManager result;
        final SelectedMailbox selectedMailbox = session.getSelected();
        if (selectedMailbox == null) {
            result = null;
        } else {
            final MailboxManager mailboxManager = getMailboxManager();
            result = mailboxManager.getMailbox(selectedMailbox.getPath(), ImapSessionUtils.getMailboxSession(session));
        }
        return result;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

        try {
            final SelectedMailbox selected = session.getSelected();
            if (selected != null && selected.getPath().equals(mailboxPath)) {
                session.deselect();
            }
            final MailboxManager mailboxManager = getMailboxManager();
            mailboxManager.deleteMailbox(mailboxPath, ImapSessionUtils.getMailboxSession(session));
            unsolicitedResponses(session, responder, false);
            okComplete(command, tag, responder);
        } catch (MailboxNotFoundException e) {
            if (session.getLog().isDebugEnabled()) {
                session.getLog().debug("Delete failed for mailbox " + mailboxPath + " as it not exist", e);
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

    }

    @Override
    protected void doProcess(DeleteACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) {

        final MailboxManager mailboxManager = getMailboxManager();
        final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
        final String mailboxName = message.getMailboxName();
        final String identifier = message.getIdentifier();
        try {
           
            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);

            /*
             * RFC 4314 section 6.
             * An implementation MUST make sure the ACL commands themselves do
             * not give information about mailboxes with appropriately
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

    }

    @Override
    protected void doProcess(ListRightsRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) {

        final MailboxManager mailboxManager = getMailboxManager();
        final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
        final String mailboxName = message.getMailboxName();
        final String identifier = message.getIdentifier();
        try {

            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);

            /*
             * RFC 4314 section 6.
             * An implementation MUST make sure the ACL commands themselves do
             * not give information about mailboxes with appropriately
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

    }

    @Override
    protected void doProcess(SetACLRequest message, ImapSession session, String tag, ImapCommand command, Responder responder) {

        final MailboxManager mailboxManager = getMailboxManager();
        final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
        final String mailboxName = message.getMailboxName();
        final String identifier = message.getIdentifier();
        try {
           
            /* parsing the rights is the the cheapest thing to begin with */
            EditMode editMode = MailboxACL.EditMode.REPLACE;
            String rights = message.getRights();
            if (rights != null && rights.length() > 0) {
                switch (rights.charAt(0)) {
                case MailboxACL.ADD_RIGHTS_MARKER:
                    editMode = MailboxACL.EditMode.ADD;
                    rights = rights.substring(1);
                    break;
                case MailboxACL.REMOVE_RIGHTS_MARKER:
                    editMode = MailboxACL.EditMode.REMOVE;
                    rights = rights.substring(1);
                    break;
                }
            }
            MailboxACLRights mailboxAclRights = new Rfc4314Rights(rights);

            MessageManager messageManager = mailboxManager.getMailbox(buildFullPath(session, mailboxName), mailboxSession);

            /*
             * RFC 4314 section 6.
             * An implementation MUST make sure the ACL commands themselves do
             * not give information about mailboxes with appropriately
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

    protected void doProcess(final IdleRequest message, final ImapSession session, final String tag, final ImapCommand command, final Responder responder) {

        try {
         
            final MailboxManager mailboxManager = getMailboxManager();
            final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
            final SelectedMailbox sm = session.getSelected();
            final MailboxListener idleListener;
            if (sm != null) {
                idleListener = new IdleMailboxListener(session, responder);
                mailboxManager.addListener(sm.getPath(), idleListener , mailboxSession);
            } else {
                idleListener = null;
            }

            final AtomicBoolean idleActive = new AtomicBoolean(true);
           
            session.pushLineHandler(new ImapLineHandler() {

                /**
                 * @see
                 * org.apache.james.imap.api.process.ImapLineHandler
                 * #onLine(org.apache.james.imap.api.process.ImapSession, byte[])
                 */
                public void onLine(ImapSession session, byte[] data) {
                    String line;
                    if (data.length > 2) {
                        line = new String(data, 0, data.length - 2);
                    } else {
                        line = "";
                    }

                    if (idleListener != null) {
                        try {
                            mailboxManager.removeListener(sm.getPath(), idleListener, mailboxSession);
                        } catch (MailboxException e) {
                            if (session.getLog().isInfoEnabled()) {
                                session.getLog().info("Unable to remove idle listener from mailbox", e);
                            }
                        }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxManager

        final Date datetime = request.getDatetime();
        final Flags flags = request.getFlags();
        try {

            final MailboxPath mailboxPath = buildFullPath(session, mailboxName);
            final MailboxManager mailboxManager = getMailboxManager();
            final MessageManager mailbox = mailboxManager.getMailbox(mailboxPath, ImapSessionUtils.getMailboxSession(session));
            appendToMailbox(messageIn, datetime, flags, session, tag, command, mailbox, responder, mailboxPath);
        } catch (MailboxNotFoundException e) {
            // consume message on exception
            consume(messageIn);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.