1:登录退出
可以通过添加监听器,来判断是否登录退出成功
1:对登录的参数进行设置
jaxmpp.getSessionObject().setUserProperty(JaxmppCore.AUTOADD_STANZA_ID_KEY,true);
jaxmpp.getConnectionConfiguration().setUserJID(jid.getBareJid());
jaxmpp.getConnectionConfiguration().setUserPassword(password);
jaxmpp.getProperties().setUserProperty(SocketConnector.SERVER_HOST,"localhost");
2:对登录退出进行监听
//监听登录jaxmpp.login()
jaxmpp.addListener(Jaxmpp.Connected,newListener<JaxmppEvent>() {
publicvoidhandleEvent(JaxmppEvent be) <