本文整理汇总了Java中org.jivesoftware.smack.packet.XMPPError.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java XMPPError.getMessage方法的具体用法?Java XMPPError.getMessage怎么用?Java XMPPError.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.smack.packet.XMPPError
的用法示例。
在下文中一共展示了XMPPError.getMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<FormField.Option> it = field.getOptions(); it.hasNext();) {
variable = it.next().getValue();
if (variable.equals(Socks5BytestreamManager.NAMESPACE) && !IBB_ONLY) {
isByteStream = true;
}
else if (variable.equals(InBandBytestreamManager.NAMESPACE)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
if (isByteStream && isIBB && field.getType().equals(FormField.TYPE_LIST_MULTI)) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager,
inbandTransferManager);
}
else if (isByteStream) {
return byteStreamTransferManager;
}
else {
return inbandTransferManager;
}
}
示例2: getOutgoingNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getOutgoingNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<String> it = field.getValues(); it.hasNext();) {
variable = it.next();
if (variable.equals(Socks5BytestreamManager.NAMESPACE) && !IBB_ONLY) {
isByteStream = true;
}
else if (variable.equals(InBandBytestreamManager.NAMESPACE)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
if (isByteStream && isIBB) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager, inbandTransferManager);
}
else if (isByteStream) {
return byteStreamTransferManager;
}
else {
return inbandTransferManager;
}
}
示例3: getNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<FormField.Option> it = field.getOptions(); it.hasNext();) {
variable = it.next().getValue();
if (variable.equals(Socks5BytestreamManager.NAMESPACE) && !IBB_ONLY) {
isByteStream = true;
}
else if (variable.equals(InBandBytestreamManager.NAMESPACE)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
//if (isByteStream && isIBB && field.getType().equals(FormField.TYPE_LIST_MULTI)) {
if (isByteStream && isIBB) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager,
inbandTransferManager);
}
else if (isByteStream) {
return byteStreamTransferManager;
}
else {
return inbandTransferManager;
}
}
示例4: getNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<FormField.Option> it = field.getOptions(); it.hasNext();) {
variable = it.next().getValue();
if (variable.equals(Socks5BytestreamManager.NAMESPACE) && !IBB_ONLY) {
isByteStream = true;
} else if (variable.equals(InBandBytestreamManager.NAMESPACE)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
// if (isByteStream && isIBB &&
// field.getType().equals(FormField.TYPE_LIST_MULTI)) {
if (isByteStream && isIBB) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager, inbandTransferManager);
} else if (isByteStream) {
return byteStreamTransferManager;
} else {
return inbandTransferManager;
}
}
示例5: getOutgoingNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getOutgoingNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<String> it = field.getValues(); it.hasNext();) {
variable = it.next();
if (variable.equals(Socks5BytestreamManager.NAMESPACE) && !IBB_ONLY) {
isByteStream = true;
} else if (variable.equals(InBandBytestreamManager.NAMESPACE)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
if (isByteStream || isIBB) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager, inbandTransferManager);
} else if (isByteStream) {
return byteStreamTransferManager;
} else {
return inbandTransferManager;
}
}
示例6: getNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<FormField.Option> it = field.getOptions(); it.hasNext();) {
variable = it.next().getValue();
if (variable.equals(BYTE_STREAM) && !IBB_ONLY) {
isByteStream = true;
}
else if (variable.equals(INBAND_BYTE_STREAM)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
if (isByteStream && isIBB && field.getType().equals(FormField.TYPE_LIST_MULTI)) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager.createNegotiator(),
inbandTransferManager);
}
else if (isByteStream) {
return byteStreamTransferManager.createNegotiator();
}
else {
return inbandTransferManager;
}
}
示例7: getOutgoingNegotiator
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
private StreamNegotiator getOutgoingNegotiator(final FormField field)
throws XMPPException {
String variable;
boolean isByteStream = false;
boolean isIBB = false;
for (Iterator<String> it = field.getValues(); it.hasNext();) {
variable = it.next();
if (variable.equals(BYTE_STREAM) && !IBB_ONLY) {
isByteStream = true;
}
else if (variable.equals(INBAND_BYTE_STREAM)) {
isIBB = true;
}
}
if (!isByteStream && !isIBB) {
XMPPError error = new XMPPError(XMPPError.Condition.bad_request,
"No acceptable transfer mechanism");
throw new XMPPException(error.getMessage(), error);
}
if (isByteStream && isIBB) {
return new FaultTolerantNegotiator(connection,
byteStreamTransferManager.createNegotiator(), inbandTransferManager);
}
else if (isByteStream) {
return byteStreamTransferManager.createNegotiator();
}
else {
return inbandTransferManager;
}
}
示例8: Message
import org.jivesoftware.smack.packet.XMPPError; //导入方法依赖的package包/类
/**
* Construct a message from a smack message packet.
* @param smackMsg Smack message packet
*/
public Message(final org.jivesoftware.smack.packet.Message smackMsg) {
this(smackMsg.getTo());
switch (smackMsg.getType()) {
case chat:
mType = MSG_TYPE_CHAT;
break;
case groupchat:
mType = MSG_TYPE_GROUP_CHAT;
break;
case normal:
mType = MSG_TYPE_NORMAL;
break;
// TODO gerer les message de type error
// this a little work around waiting for a better handling of error
// messages
case error:
mType = MSG_TYPE_ERROR;
break;
default:
mType = MSG_TYPE_NORMAL;
break;
}
this.mFrom = smackMsg.getFrom();
//TODO better handling of error messages
if (mType == MSG_TYPE_ERROR) {
XMPPError er = smackMsg.getError();
String msg = er.getMessage();
if (msg != null)
mBody = msg;
else
mBody = er.getCondition();
} else {
mBody = smackMsg.getBody();
mSubject = smackMsg.getSubject();
mThread = smackMsg.getThread();
}
PacketExtension pTime = smackMsg.getExtension("delay", "urn:xmpp:delay");
if (pTime instanceof DelayInformation) {
mTimestamp = ((DelayInformation) pTime).getStamp();
} else {
mTimestamp = new Date();
}
}