本文整理汇总了Java中org.jivesoftware.smack.packet.StreamError.getCode方法的典型用法代码示例。如果您正苦于以下问题:Java StreamError.getCode方法的具体用法?Java StreamError.getCode怎么用?Java StreamError.getCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.smack.packet.StreamError
的用法示例。
在下文中一共展示了StreamError.getCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectionClosedOnError
import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e) {
done = false;
if (e instanceof XMPPException) {
XMPPException xmppEx = (XMPPException) e;
StreamError error = xmppEx.getStreamError();
// Make sure the error is not null
if (error != null) {
String reason = error.getCode();
if ("conflict".equals(reason)) {
return;
}
}
}
if (this.isReconnectionAllowed()) {
this.reconnect();
}
}
示例2: connectionClosedOnError
import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e) {
done = false;
if (e instanceof XMPPException) {
XMPPException xmppEx = (XMPPException) e;
StreamError error = xmppEx.getStreamError();
// Make sure the error is not null
if (error != null) {
String reason = error.getCode();
if ("conflict".equals(reason)) {
return;
}
}
}
if (this.isReconnectionAllowed()) {
this.reconnect();
}
}
示例3: connectionClosedOnError
import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception e)
{
done = false;
if (e instanceof XMPPException)
{
XMPPException xmppEx = (XMPPException) e;
StreamError error = xmppEx.getStreamError();
// Make sure the error is not null
if (error != null)
{
String reason = error.getCode();
if ("conflict".equals(reason))
{
return;
}
}
}
if (this.isReconnectionAllowed())
{
this.reconnect();
}
}
示例4: connectionClosedOnError
import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(Exception ex) {
handleDisconnect();
String message = Res.getString("message.disconnected.error");
if (ex instanceof XMPPException) {
XMPPException xmppEx = (XMPPException)ex;
StreamError error = xmppEx.getStreamError();
String reason = error.getCode();
if ("conflict".equals(reason)) {
message = Res.getString("message.disconnected.conflict.error");
}
}
getTranscriptWindow().insertNotificationMessage(message, ChatManager.ERROR_COLOR);
}
示例5: connectionClosedOnError
import org.jivesoftware.smack.packet.StreamError; //导入方法依赖的package包/类
public void connectionClosedOnError(final Exception ex) {
String errorMessage = Res.getString("message.disconnected.error");
if (ex != null && ex instanceof XMPPException) {
XMPPException xmppEx = (XMPPException) ex;
StreamError error = xmppEx.getStreamError();
String reason = error.getCode();
if ("conflict".equals(reason)) {
errorMessage = Res
.getString("message.disconnected.conflict.error");
} else if ("system-shutdown".equals(reason)) {
errorMessage = Res.getString("message.disconnected.shutdown");
} else {
errorMessage = Res.getString("message.general.error", reason);
}
}
switch (localPreferences.getReconnectPanelType()) {
case 0:
final String message = errorMessage;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
_reconnectPanel.setClosedOnError(true);
reconnect(message);
}
});
break;
case 1:
switchAllUserOffline(true);
_reconnectpanelsmall.setReconnectText(errorMessage);
break;
case 2:
switchAllUserOfflineNoGroupEntry(true);
_reconnectpanelicon.setReconnectText(errorMessage);
break;
}
}