Package org.apache.james.imap.api

Examples of org.apache.james.imap.api.ImapMessage


     * @param request
     *            <code>ImapRequestLineReader</code>, not null
     * @return <code>ImapCommandMessage</code>, not null
     */
    public final ImapMessage parse(ImapRequestLineReader request, String tag, ImapSession session) {
        ImapMessage result;
        if (!command.validForState(session.getState())) {
            result = statusResponseFactory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
        } else {
            try {

View Full Code Here


        this.processor = processor;
        this.encoder = encoder;
    }

    protected boolean doProcessRequest(ImapRequestLineReader request, ImapResponseComposer response, ImapSession session) {
        ImapMessage message = decoder.decode(request, session);
        final ResponseEncoder responseEncoder = new ResponseEncoder(encoder, response, session);
        processor.process(message, responseEncoder, session);

        final boolean result;
        final IOException failure = responseEncoder.getFailure();
View Full Code Here

     * @param request
     *            <code>ImapRequestLineReader</code>, not null
     * @return <code>ImapCommandMessage</code>, not null
     */
    public final ImapMessage parse(ImapRequestLineReader request, String tag, ImapSession session) {
        ImapMessage result;
        if (!command.validForState(session.getState())) {
            result = statusResponseFactory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
        } else {
            try {

View Full Code Here

        if (datetime == null) {
            datetime = new Date();
        }
        request.nextWordChar();

        final ImapMessage result = new AppendRequest(command, mailboxName, flags, datetime, request.consumeLiteral(true), tag);
        return result;
    }
View Full Code Here

        super(ImapCommand.authenticatedStateCommand(ImapConstants.XLIST_COMMAND_NAME));
    }

    @Override
    protected ImapMessage createMessage(ImapCommand command, final String referenceName, final String mailboxPattern, final String tag) {
        final ImapMessage result = new XListRequest(command, referenceName, mailboxPattern, tag);
        return result;
    }
View Full Code Here

     * org.apache.james.imap.decode.ImapRequestLineReader, java.lang.String,
     * org.apache.james.imap.api.process.ImapSession)
     */
    protected ImapMessage decode(ImapCommand command, ImapRequestLineReader request, String tag, ImapSession session) throws DecodingException {
        request.eol();
        final ImapMessage result = new LogoutRequest(command, tag);
        return result;
    }
View Full Code Here

     * org.apache.james.imap.api.process.ImapSession)
     */
    protected ImapMessage decode(ImapCommand command, ImapRequestLineReader request, String tag, ImapSession session) throws DecodingException {
        final String mailboxName = request.mailbox();
        request.eol();
        final ImapMessage result = new SelectRequest(command, mailboxName, tag);
        return result;
    }
View Full Code Here

     */
    protected ImapMessage decode(ImapCommand command, ImapRequestLineReader request, String tag, ImapSession session) throws DecodingException {
        String mailboxName = request.mailbox();
        request.eol();

        final ImapMessage result = new DeleteRequest(command, mailboxName, tag);
        return result;
    }
View Full Code Here

        // TODO: replace abstract class with interface
        if (helperCommand == null || !(helperCommand instanceof AbstractUidCommandParser)) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Invalid UID command: '" + commandName + "'");
        }
        final AbstractUidCommandParser uidEnabled = (AbstractUidCommandParser) helperCommand;
        final ImapMessage result = uidEnabled.decode(request, tag, true, session);
        return result;
    }
View Full Code Here

           
            if (options == null) {
                options = new ArrayList<SearchResultOption>();
            }
           
            final ImapMessage result = new SearchRequest(command, new SearchOperation(finalKey, options), useUids, tag);
            return result;
        } catch (IllegalCharsetNameException e) {
            session.getLog().debug("Unable to decode request", e);
            return unsupportedCharset(tag, command);
        } catch (UnsupportedCharsetException e) {
View Full Code Here

TOP

Related Classes of org.apache.james.imap.api.ImapMessage

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.