Package org.apache.james.imap.decode

Examples of org.apache.james.imap.decode.ImapCommandParser


        }
    }

    private ImapCommandParser createCommand(Class<?> commandClass) {
        try {
            ImapCommandParser cmd = (ImapCommandParser) commandClass.newInstance();
            initialiseParser(cmd);
            return cmd;
        } catch (Exception e) {
            // TODO: would probably be better to manage this in protocol
            // TODO: this runtime will produce a nasty disconnect for the client
View Full Code Here


        // TODO: suspect that it is now bust
        // TODO: the command written may be wrong
        // TODO: this will be easier to fix a little later
        // TODO: also not sure whether the old implementation shares this flaw
        String commandName = request.atom();
        ImapCommandParser helperCommand = parserFactory.getParser(commandName);
        // 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;
View Full Code Here

    private ImapMessage decodeCommandNamed(final ImapRequestLineReader request, final String tag, String commandName, final ImapSession session) {
        ImapMessage message;
        if (session.getLog().isDebugEnabled()) {
            session.getLog().debug("Got <command>: " + commandName);
        }
        final ImapCommandParser command = imapCommands.getParser(commandName);
        if (command == null) {
            if (session.getLog().isInfoEnabled()) {
                session.getLog().info("Missing command implementation for commmand " + commandName);
            }
            message = unknownCommand(tag, session);
        } else {
            message = command.parse(request, tag, session);
            session.setAttribute(INVALID_COMMAND_COUNT, 0);
        }
        return message;
    }
View Full Code Here

        }
    }

    private ImapCommandParser createCommand(Class<?> commandClass) {
        try {
            ImapCommandParser cmd = (ImapCommandParser) commandClass.newInstance();
            initialiseParser(cmd);
            return cmd;
        } catch (Exception e) {
            // TODO: would probably be better to manage this in protocol
            // TODO: this runtime will produce a nasty disconnect for the client
View Full Code Here

        // TODO: suspect that it is now bust
        // TODO: the command written may be wrong
        // TODO: this will be easier to fix a little later
        // TODO: also not sure whether the old implementation shares this flaw
        String commandName = request.atom();
        ImapCommandParser helperCommand = parserFactory.getParser(commandName);
        // 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;
View Full Code Here

    private ImapMessage decodeCommandNamed(final ImapRequestLineReader request, final String tag, String commandName, final ImapSession session) {
        ImapMessage message;
        if (session.getLog().isDebugEnabled()) {
            session.getLog().debug("Got <command>: " + commandName);
        }
        final ImapCommandParser command = imapCommands.getParser(commandName);
        if (command == null) {
            session.getLog().info("Missing command implementation.");
            message = unknownCommand(tag, session);
        } else {
            message = command.parse(request, tag, session);
            session.setAttribute(INVALID_COMMAND_COUNT, 0);
        }
        return message;
    }
View Full Code Here

TOP

Related Classes of org.apache.james.imap.decode.ImapCommandParser

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.