msnsessionlistener.java

来自「基于Jabber协议的即时消息服务器」· Java 代码 · 共 65 行

JAVA
65
字号
/** * $Revision$ * $Date$ * * Copyright (C) 2006 Jive Software. All rights reserved. * * This software is published under the terms of the GNU Public License (GPL), * a copy of which is included in this distribution. */package org.jivesoftware.wildfire.gateway.protocols.msn;import net.sf.cindy.SessionAdapter;import net.sf.cindy.Session;import net.sf.cindy.Message;import org.jivesoftware.util.Log;/** * MSN Session Listener Interface. * * This handles listening to session activities. * * @author lionheart@clansk.org * @author Daniel Henninger */public class MsnSessionListener extends SessionAdapter {    public MsnSessionListener(MSNSession msnSession) {        this.msnSession = msnSession;    }    /**     * The session this listener is associated with.     */    public MSNSession msnSession = null;    public void exceptionCaught(Session arg0, Throwable t) throws Exception{        Log.debug("MSN: Session exceptionCaught for "+msnSession.getRegistration().getUsername()+" : "+t);    }    public void messageReceived(Session arg0, Message message) throws Exception {        Log.debug("MSN: Session messageReceived for "+msnSession.getRegistration().getUsername()+" : "+message);    }    public void messageSent(Session arg0, Message message) throws Exception {        Log.debug("MSN: Session messageSent for "+msnSession.getRegistration().getUsername()+" : "+message);    }    public void sessionIdle(Session session) throws Exception {    }    public void sessionEstablished(Session session) {        Log.debug("MSN: Session established for "+msnSession.getRegistration().getUsername());    }    public void sessionTimeout(Session session) {        // This is used to handle regular pings to the MSN server.  No need to mention it.    }    public void sessionClosed(Session session) {        Log.debug("MSN: Session closed for "+msnSession.getRegistration().getUsername());    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?