Package mireka.pop

Examples of mireka.pop.IllegalSessionStateException


    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();

        List<String> args = commandParser.parseArguments();
        if (args.size() != 2)
            throw new CommandSyntaxException(
                    "Two numeric arguments are expected");
View Full Code Here


    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != AUTHORIZATION_PASS_COMMAND_EXPECTED)
            throw new IllegalSessionStateException();
        String password = commandParser.parseSingleExtendedArgument();
        LoginResult result =
                loginSpecification.evaluatePlain(userCommand.user, password);
        if (result.decision == LoginDecision.VALID) {
            startTransaction(result.principal);
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();
        session.getMaildrop()
                .delete(commandParser.parseSingleNumericArgument());
        session.getThread().sendResponse("+OK message deleted");
    }
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != AUTHORIZATION)
            throw new IllegalSessionStateException();
        if (session.isTlsStarted())
            throw new Pop3Exception(null,
                    "Command not permitted when TLS active");
        session.getThread().sendResponse("+OK Begin TLS negotiation");
        SSLSocket sslSocket =
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();

        List<String> args = commandParser.parseArguments();
        if (args.isEmpty())
            displayList();
        else
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != AUTHORIZATION)
            throw new IllegalSessionStateException();
        user = commandParser.parseSingleArgument();
        session.setSessionState(AUTHORIZATION_PASS_COMMAND_EXPECTED);
        session.getThread().sendResponse("+OK Proceed to password");
    }
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();

        List<String> args = commandParser.parseArguments();
        if (args.isEmpty())
            displayList();
        else
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();

        StringBuilder response = new StringBuilder();
        response.append("+OK ");
        response.append(session.getMaildrop().getCountOfMessages());
        response.append(' ');
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();
        try {
            session.getMaildrop().resetDeletions();
        } catch (IllegalArgumentException e) {
            session.getThread().sendResponse("-ERR " + e.getMessage());
            return;
View Full Code Here

    @Override
    public void execute(CommandParser commandParser) throws IOException,
            Pop3Exception {
        if (session.getSessionState() != SessionState.TRANSACTION)
            throw new IllegalSessionStateException();

        int messageNumber = commandParser.parseSingleNumericArgument();
        ScanListing scanListing =
                session.getMaildrop().getScanListing(messageNumber);
        InputStream mailAsStream =
View Full Code Here

TOP

Related Classes of mireka.pop.IllegalSessionStateException

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.