use of org.jivesoftware.smack.packet.PacketExtension in project intellij-plugins by JetBrains.
the class JabberTransport method processResponse.
private static void processResponse(XmlMessage xmlMessage, PacketCollector collector) {
boolean gotResponse = false;
while (!gotResponse) {
Message response = (Message) collector.nextResult(RESPONSE_TIMEOUT);
if (response == null)
break;
final Collection<PacketExtension> extensions = response.getExtensions();
for (PacketExtension o : extensions) {
if (o instanceof JDOMExtension) {
JDOMExtension extension = (JDOMExtension) o;
if (RESPONSE.equals(extension.getElement().getName())) {
xmlMessage.processResponse(extension.getElement());
gotResponse = true;
break;
}
}
}
}
}
use of org.jivesoftware.smack.packet.PacketExtension in project ecf by eclipse.
the class ItemsExtension method toXML.
@Override
public String toXML() {
if ((items == null) || (items.size() == 0)) {
return super.toXML();
} else {
StringBuilder builder = new StringBuilder("<");
builder.append(getElementName());
builder.append(" node='");
builder.append(getNode());
if (notify != null) {
builder.append("' ");
builder.append(type.getElementAttribute());
builder.append("='");
builder.append(notify.equals(Boolean.TRUE) ? 1 : 0);
builder.append("'>");
} else {
builder.append("'>");
for (PacketExtension item : items) {
builder.append(item.toXML());
}
}
builder.append("</");
builder.append(getElementName());
builder.append(">");
return builder.toString();
}
}
Aggregations