Package org.apache.james.imap.message.response

Examples of org.apache.james.imap.message.response.MailboxStatusResponse


           
            // Enable CONDSTORE as this is a CONDSTORE enabling command
            if (highestModSeq != null) {
                condstoreEnablingCommand(session, responder, metaData, false);
            }
            final MailboxStatusResponse response = new MailboxStatusResponse(messages, recent, uidNext, highestModSeq, uidValidity, unseen, request.getMailboxName());
            responder.respond(response);
            unsolicitedResponses(session, responder, false);
            okComplete(command, tag, responder);

        } catch (MailboxException e) {
View Full Code Here


    public MailboxStatusResponseEncoder(ImapEncoder next) {
        super(next);
    }

    protected void doEncode(ImapMessage acceptableMessage, ImapResponseComposer composer, ImapSession session) throws IOException {
        MailboxStatusResponse response = (MailboxStatusResponse) acceptableMessage;
        Long messages = response.getMessages();
        Long recent = response.getRecent();
        Long uidNext = response.getUidNext();
        Long highestModSeq = response.getHighestModSeq();
        Long uidValidity = response.getUidValidity();
        Long unseen = response.getUnseen();
        String mailboxName = response.getMailbox();

        composer.untagged();
        composer.message(STATUS_COMMAND_NAME);
        composer.quote(mailboxName);
        composer.openParen();
View Full Code Here

    }
   

    @Test
    public void testIsAcceptable() throws Exception {
        assertTrue(encoder.isAcceptable(new MailboxStatusResponse(null, null, null,
                null, null, null, "mailbox")));
        assertFalse(encoder.isAcceptable(context.mock(ImapMessage.class)));
        assertFalse(encoder.isAcceptable(null));
    }
View Full Code Here

        final Long uidNext = new Long(5);
        final Long uidValidity = new Long(7);
        final Long unseen = new Long(11);
        final String mailbox = "A mailbox named desire";

        encoder.encode(new MailboxStatusResponse(messages, recent, uidNext,
                null, uidValidity, unseen, mailbox), composer, new FakeImapSession());
        assertEquals("* STATUS \"A mailbox named desire\" (MESSAGES 2 RECENT 3 UIDNEXT 5 UIDVALIDITY 7 UNSEEN 11)\r\n", writer.getString());
    }
View Full Code Here

            final Long recent = recent(statusDataItems, metaData);
            final Long uidNext = uidNext(statusDataItems, metaData);
            final Long uidValidity = uidValidity(statusDataItems, metaData);
            final Long unseen = unseen(statusDataItems, metaData);

            final MailboxStatusResponse response = new MailboxStatusResponse(messages, recent, uidNext, uidValidity, unseen, request.getMailboxName());
            responder.respond(response);
            unsolicitedResponses(session, responder, false);
            okComplete(command, tag, responder);

        } catch (MailboxException e) {
View Full Code Here

    }
   

    @Test
    public void testIsAcceptable() throws Exception {
        assertTrue(encoder.isAcceptable(new MailboxStatusResponse(null, null, null,
                null, null, "mailbox")));
        assertFalse(encoder.isAcceptable(context.mock(ImapMessage.class)));
        assertFalse(encoder.isAcceptable(null));
    }
View Full Code Here

                    with(same(unseen)),
                    with(same(mailbox))
                    );
        }});

        encoder.encode(new MailboxStatusResponse(messages, recent, uidNext,
                uidValidity, unseen, mailbox), composer, new FakeImapSession());
    }
View Full Code Here

    public MailboxStatusResponseEncoder(ImapEncoder next) {
        super(next);
    }

    protected void doEncode(ImapMessage acceptableMessage, ImapResponseComposer composer, ImapSession session) throws IOException {
        MailboxStatusResponse response = (MailboxStatusResponse) acceptableMessage;
        composer.statusResponse(response.getMessages(), response.getRecent(), response.getUidNext(), response.getUidValidity(), response.getUnseen(), response.getMailbox());

    }
View Full Code Here

TOP

Related Classes of org.apache.james.imap.message.response.MailboxStatusResponse

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.