org.jivesoftware.smack.packet.Message.getError()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.jivesoftware.smack.packet.Message.getError()方法的一些代码示例,展示了Message.getError()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getError()方法的具体详情如下:
包路径:org.jivesoftware.smack.packet.Message
类名称:Message
方法名:getError

Message.getError介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Smack

public static BlockedErrorExtension from(Message message) {
  StanzaError error = message.getError();
  if (error == null) {
    return null;
  }
  return error.getExtension(ELEMENT, NAMESPACE);
}

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

XMPPError error = getError();
if (error != null) {
  buf.append(error.toXML());

代码示例来源:origin: org.igniterealtime.smack/smack

XMPPError error = getError();
if (error != null) {
  buf.append(error.toXML());

代码示例来源:origin: Blazemeter/jmeter-bzm-plugins

private SampleResult waitResponse(SampleResult res, String recipient) throws InterruptedException, SmackException {
  long time = 0;
  do {
    Iterator<Message> packets = responseMessages.iterator();
    Thread.sleep(conn.getPacketReplyTimeout() / 100); // optimistic
    while (packets.hasNext()) {
      Packet packet = packets.next();
      Message response = (Message) packet;
      if (XmppStringUtils.parseBareAddress(response.getFrom()).equals(recipient)) {
        packets.remove();
        res.setResponseData(response.toXML().toString().getBytes());
        if (response.getError() != null) {
          res.setSuccessful(false);
          res.setResponseCode("500");
          res.setResponseMessage(response.getError().toString());
        }
        return res;
      }
    }
    time += conn.getPacketReplyTimeout() / 10;
    Thread.sleep(conn.getPacketReplyTimeout() / 10);
  } while (time < conn.getPacketReplyTimeout());
  throw new SmackException.NoResponseException();
}

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

XMPPError error = getError();
if (error != null) {
  buf.append(error.toXML());

代码示例来源:origin: tiandawu/IotXmpp

XMPPError error = getError();
if (error != null) {
  buf.append(error.toXML());

代码示例来源:origin: igniterealtime/Spark

Type type = message.getType();
  if (message.getError() != null) {
    return;

代码示例来源:origin: igniterealtime/Spark

@Override
public void processStanza(final Stanza stanza) {
  SwingUtilities.invokeLater( () -> {
    try {
      final Message message = (Message)stanza;
      // Do not handle errors or offline messages
      final DelayInformation offlineInformation = message.getExtension("delay", "urn:xmpp:delay");
      if (offlineInformation != null || message.getError() != null) {
        return;
      }
      final JivePropertiesExtension extension = ((JivePropertiesExtension) message.getExtension( JivePropertiesExtension.NAMESPACE ));
      final boolean broadcast = extension != null && extension.getProperty( "broadcast" ) != null;
      if ((broadcast || message.getType() == Type.normal
        || message.getType() == Type.headline) && message.getBody() != null) {
        showAlert((Message)stanza);
      }
      else {
        String host = SparkManager.getSessionManager().getServerAddress();
        String from = stanza.getFrom() != null ? stanza.getFrom().toString() : "";
        if (host.equalsIgnoreCase(from) || !ModelUtil.hasLength(from)) {
          showAlert((Message)stanza);
        }
      }
    }
    catch (Exception e) {
      Log.error(e);
    }
  } );
}

代码示例来源:origin: org.igniterealtime.smack/smackx

throw new XMPPException("No response from server.");
else if (answer.getError() != null) {
  throw new XMPPException(answer.getError());

代码示例来源:origin: tiandawu/IotXmpp

throw new XMPPException("No response from server.");
else if (answer.getError() != null) {
  throw new XMPPException(answer.getError());

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

throw new XMPPException("No response from server.");
else if (answer.getError() != null) {
  throw new XMPPException(answer.getError());

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

throw new XMPPException("No response from server.");
else if (answer.getError() != null) {
  throw new XMPPException(answer.getError());

代码示例来源:origin: igniterealtime/Spark

if ( message.getError() != null )
  if ( message.getError().getCondition() == StanzaError.Condition.item_not_found )

代码示例来源:origin: igniterealtime/Spark

else if ( message.getError() != null )
  if ( message.getError().getCondition() == StanzaError.Condition.forbidden && message.getSubject() != null )
  else if ( message.getError().getCondition() == StanzaError.Condition.forbidden )

相关文章