private static List<String> getSubscriptionIds(Packet packet) { HeadersExtension headers = (HeadersExtension)packet.getExtension("headers", "http://jabber.org/protocol/shim"); List<String> values = null; if (headers != null) { values = new ArrayList<String>(headers.getHeaders().size()); for (Header header : headers.getHeaders()) { values.add(header.getValue()); } } return values; }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { String name = parser.getAttributeValue(null, "name"); String value = null; parser.next(); if (parser.getEventType() == XmlPullParser.TEXT) value = parser.getText(); while(parser.getEventType() != XmlPullParser.END_TAG) parser.next(); return new Header(name, value); }
private static List<String> getSubscriptionIds(Packet packet) { HeadersExtension headers = (HeadersExtension) packet.getExtension( "headers", "http://jabber.org/protocol/shim"); List<String> values = null; if (headers != null) { values = new ArrayList<String>(headers.getHeaders().size()); for (Header header : headers.getHeaders()) { values.add(header.getValue()); } } return values; }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { String name = parser.getAttributeValue(null, "name"); String value = null; parser.next(); if (parser.getEventType() == XmlPullParser.TEXT) value = parser.getText(); while (parser.getEventType() != XmlPullParser.END_TAG) parser.next(); return new Header(name, value); }
@Override protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content) { return new HeadersExtension((Collection<Header>)content); }
@Override protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content) { return new HeadersExtension((Collection<Header>) content); }