当前位置: 首页>>代码示例>>Java>>正文


Java XMPPError.getMessage方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:34,代码来源:FileTransferNegotiator.java

示例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;
    }
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:33,代码来源:FileTransferNegotiator.java

示例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;
    }
}
 
开发者ID:CJC-ivotten,项目名称:androidPN-client.,代码行数:35,代码来源:FileTransferNegotiator.java

示例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;
	}
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:32,代码来源:FileTransferNegotiator.java

示例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;
	}
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:30,代码来源:FileTransferNegotiator.java

示例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;
    }
}
 
开发者ID:phoenixNirvana,项目名称:NewCommunication-Android,代码行数:34,代码来源:FileTransferNegotiator.java

示例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;
    }
}
 
开发者ID:phoenixNirvana,项目名称:NewCommunication-Android,代码行数:33,代码来源:FileTransferNegotiator.java

示例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();
}
   }
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:48,代码来源:Message.java


注:本文中的org.jivesoftware.smack.packet.XMPPError.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。