Search in sources :

Example 1 with StanzaType

use of org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType in project Smack by igniterealtime.

the class OpenIQProvider method parse.

@Override
public Open parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException {
    String sessionID = parser.getAttributeValue("", "sid");
    int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size"));
    String stanzaValue = parser.getAttributeValue("", "stanza");
    StanzaType stanza = null;
    if (stanzaValue == null) {
        stanza = StanzaType.IQ;
    } else {
        stanza = StanzaType.valueOf(stanzaValue.toUpperCase(Locale.US));
    }
    parser.next();
    return new Open(sessionID, blockSize, stanza);
}
Also used : StanzaType(org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType) Open(org.jivesoftware.smackx.bytestreams.ibb.packet.Open)

Aggregations

StanzaType (org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType)1 Open (org.jivesoftware.smackx.bytestreams.ibb.packet.Open)1