Package org.apache.james.imap.api.process

Examples of org.apache.james.imap.api.process.ImapSession.logout()


    public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
        logger.debug("Error while processing imap request" ,e.getCause());
       
        // logout on error not sure if that is the best way to handle it
        final ImapSession imapSession = (ImapSessionImpl) getAttachment(ctx).get(IMAP_SESSION);    
        if (imapSession != null) imapSession.logout();

        // just close the channel now!
        ctx.getChannel().close();
       
        super.exceptionCaught(ctx, e);
View Full Code Here


        // remove the stored attribute for the channel to free up resources
        // See JAMES-1195
        ImapSession imapSession = (ImapSession) attributes.remove(ctx.getChannel());
        if (imapSession != null)
            imapSession.logout();

        super.channelClosed(ctx, e);
    }

    @Override
View Full Code Here

        } else {

            // logout on error not sure if that is the best way to handle it
            final ImapSession imapSession = (ImapSession) attributes.get(ctx.getChannel());
            if (imapSession != null)
                imapSession.logout();

            // Make sure we close the channel after all the buffers were flushed out
            Channel channel = ctx.getChannel();
            if (channel.isConnected()) {
                channel.write(ChannelBuffers.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
View Full Code Here

            InetSocketAddress address = (InetSocketAddress) ctx.getChannel().getRemoteAddress();

            session.getLog().info("Logout client " + address.getHostName() + " (" + address.getAddress().getHostAddress() + ") because it idled for too long...");

            // logout the client
            session.logout();

            // close the channel
            ctx.getChannel().close();

        }
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.