• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ClientConnEvent类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中net.kano.joscar.net.ClientConnEvent的典型用法代码示例。如果您正苦于以下问题:Java ClientConnEvent类的具体用法?Java ClientConnEvent怎么用?Java ClientConnEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ClientConnEvent类属于net.kano.joscar.net包,在下文中一共展示了ClientConnEvent类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleStateChange

点赞 2

import net.kano.joscar.net.ClientConnEvent; //导入依赖的package包/类
@Override
protected void handleStateChange(ClientConnEvent e) {
    Log.debug("OSCAR service state change from "+e.getOldState()+" to "+e.getNewState());
    if (e.getNewState() == ClientFlapConn.STATE_FAILED) {
        getMainSession().serviceFailed(this);
    } else if (e.getNewState() == ClientFlapConn.STATE_CONNECTED) {
        getMainSession().serviceConnected(this);
    } else if (e.getNewState() == ClientFlapConn.STATE_NOT_CONNECTED) {
        getMainSession().serviceDied(this);
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:12,
代码来源:ServiceConnection.java

示例2: handleStateChange

点赞 2

import net.kano.joscar.net.ClientConnEvent; //导入依赖的package包/类
@Override
    protected void handleStateChange(ClientConnEvent e) {
        Log.debug("OSCAR login service state change from "+e.getOldState()+" to "+e.getNewState());
        if (e.getNewState() == ClientFlapConn.STATE_CONNECTED) {
//            if (getMainSession().getTransport().getType().equals(TransportType.icq)) {
//                Log.debug("FINDME: Doing ICQ normal auth.");
//                ClientVersionInfo version = new ClientVersionInfo(
//                        "ICQBasic",
//                        0x010a, 0x0014, 0x0022, 0, 0x0911, 0x0000043d);
//                String password = oscarSession.getRegistration().getPassword();
//                // ICQ caps passwords at 8 characters.
//                if (password.length() > 8) {
//                    password = password.substring(0, 8);
//                }
//                getFlapProcessor().sendFlap(new LoginICQFlapCmd(oscarSession.getRegistration().getUsername(), password, version, Locale.US));
//            }
//            else {
                getFlapProcessor().sendFlap(new LoginFlapCmd());
                request(new KeyRequest(getMainSession().getRegistration().getUsername()));
//            }
        }
        else if (e.getNewState() == ClientFlapConn.STATE_FAILED) {
            getMainSession().setFailureStatus(ConnectionFailureReason.CAN_NOT_CONNECT);
            getMainSession().sessionDisconnected(LocaleUtils.getLocalizedString("gateway.oscar.connectionfailed", "kraken")+" " + e.getReason());
        }
        else if (e.getNewState() == ClientFlapConn.STATE_NOT_CONNECTED) {
            //TODO: Do we need to catch these?
//            if (!loggedin) {
//                Message m = new Message();
//                m.setType(Message.Type.error);
//                m.setFrom(this.getMainSession().getTransport().getJID());
//                m.setTo(this.getMainSession().getJID());
//                m.setBody("Connection lost: " + e.getReason());
//                this.getMainSession().getTransport().sendPacket(m);
//                this.getMainSession().logOut();
//            }
        }
    }
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:39,
代码来源:LoginConnection.java

示例3: handleStateChange

点赞 2

import net.kano.joscar.net.ClientConnEvent; //导入依赖的package包/类
@Override
    protected void handleStateChange(ClientConnEvent e) {
        Log.debug("OSCAR bos service state change from "+e.getOldState()+" to "+e.getNewState()+" Reason: "+e.getReason()+" User:"+getMainSession().getJID());
//        if (e.getNewState() == ClientFlapConn.STATE_NOT_CONNECTED && e.getOldState() == ClientFlapConn.STATE_CONNECTED && getMainSession().isLoggedIn()) {
//            getMainSession().sessionDisconnected(LocaleUtils.getLocalizedString("gateway.oscar.disconnected", "kraken"));
//        }
        // TODO: Evaulate whether we should check reason and triggered reconnect if possible
        if (e.getNewState().equals(ClientConn.STATE_NOT_CONNECTED) && e.getReason() != null) {
            Log.info ("OSCAR bos disconnected with Reason! call sessionDisconnectedNoReconnect for User:" + getMainSession().getJID());
            if (getMainSession()!= null) {
                getMainSession().sessionDisconnectedNoReconnect(LocaleUtils.getLocalizedString("gateway.oscar.disconnected", "kraken"));
            }
        }
    }
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:15,
代码来源:BOSConnection.java

示例4: handleStateChange

点赞 2

import net.kano.joscar.net.ClientConnEvent; //导入依赖的package包/类
@Override
protected void handleStateChange(ClientConnEvent e) {
    Log.debug("OSCAR email service state change from "+e.getOldState()+" to "+e.getNewState());
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:5,
代码来源:EmailConnection.java

示例5: handleStateChange

点赞 1

import net.kano.joscar.net.ClientConnEvent; //导入依赖的package包/类
protected abstract void handleStateChange(ClientConnEvent e); 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:2,
代码来源:AbstractFlapConnection.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)