Class Jabber::Bytestreams::IqQueryBytestreams
In: lib/xmpp4r/bytestreams/iq/bytestreams.rb
Parent: IqQuery
XMLStanza Message Presence Iq REXML::Element X IqQuery Error StreamHost IqSiFileRange IqSiFile StreamHostUsed IqSi XRosterItem RosterItem IqFeature XMUCUserItem XMUCUserInvite Feature Identity Item XDataField XDataReported XDataTitle XDataInstructions IqVcard Singleton IdGenerator Connection Client Component Comparable JID RuntimeError ErrorException AuthenticationFailure SOCKS5Error Stream SOCKS5Bytestreams SOCKS5BytestreamsTarget SOCKS5BytestreamsInitiator SOCKS5BytestreamsServerStreamHost TCPSocket SOCKS5Socket IqQuery IqQueryBytestreams IqQueryVersion IqQueryRoster IqQueryDiscoItems IqQueryDiscoInfo IBB IBBTarget IBBInitiator Responder SimpleResponder X XRoster XMUCUser XMUC XDelay XData MUCClient SimpleMUCClient Base DigestMD5 Plain FileSource StreamParser SOCKS5BytestreamsPeer SOCKS5BytestreamsServer IBBQueueItem Helper MUCBrowser Helper Helper lib/xmpp4r/authenticationfailure.rb lib/xmpp4r/idgenerator.rb lib/xmpp4r/connection.rb lib/xmpp4r/iq.rb lib/xmpp4r/jid.rb lib/xmpp4r/xmlstanza.rb lib/xmpp4r/errorexception.rb lib/xmpp4r/stream.rb lib/xmpp4r/client.rb lib/xmpp4r/streamparser.rb lib/xmpp4r/x.rb lib/xmpp4r/error.rb lib/xmpp4r/component.rb lib/xmpp4r/query.rb lib/xmpp4r/message.rb lib/xmpp4r/presence.rb lib/xmpp4r/bytestreams/helper/ibb/initiator.rb lib/xmpp4r/bytestreams/iq/si.rb lib/xmpp4r/bytestreams/iq/bytestreams.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb lib/xmpp4r/bytestreams/helper/ibb/base.rb lib/xmpp4r/bytestreams/helper/ibb/target.rb Bytestreams lib/xmpp4r/version/iq/version.rb lib/xmpp4r/version/helper/responder.rb lib/xmpp4r/version/helper/simpleresponder.rb Version lib/xmpp4r/roster/helper/roster.rb lib/xmpp4r/roster/iq/roster.rb lib/xmpp4r/roster/x/roster.rb Roster lib/xmpp4r/feature_negotiation/iq/feature.rb FeatureNegotiation lib/xmpp4r/muc/x/muc.rb lib/xmpp4r/muc/helper/mucclient.rb lib/xmpp4r/muc/x/mucuseritem.rb lib/xmpp4r/muc/helper/mucbrowser.rb lib/xmpp4r/muc/x/mucuserinvite.rb lib/xmpp4r/muc/helper/simplemucclient.rb MUC lib/xmpp4r/sasl.rb SASL lib/xmpp4r/delay/x/delay.rb Delay lib/xmpp4r/bytestreams/helper/filetransfer.rb TransferSource FileTransfer lib/xmpp4r/discovery/iq/discoinfo.rb lib/xmpp4r/discovery/iq/discoitems.rb Discovery lib/xmpp4r/dataforms/x/data.rb Dataforms lib/xmpp4r/vcard/helper/vcard.rb lib/xmpp4r/vcard/iq/vcard.rb Vcard Jabber Module: Jabber

Class for accessing <query/> elements with xmlns=’jabber.org/protocol/bytestreams’ in <iq/> stanzas.

Methods

activate   activate=   mode   mode=   new   sid   sid=   streamhost_used   typed_add  

Constants

NS_BYTESTREAMS = 'http://jabber.org/protocol/bytestreams'

Public Class methods

Initialize such a <query/>

sid:[String] Session-ID
mode:[Symbol] :tcp or :udp

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 18
18:       def initialize(sid=nil, mode=nil)
19:         super()
20:         add_namespace(IqQueryBytestreams::NS_BYTESTREAMS)
21:         self.sid = sid
22:         self.mode = mode
23:       end

Public Instance methods

Get the text of the <activate/> child

result:[JID] or [nil]

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 77
77:       def activate
78:         j = first_element_text('activate')
79:         j ? JID.new(j) : nil
80:       end

Set the text of the <activate/> child

s:[JID]

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 85
85:       def activate=(s)
86:         replace_element_text('activate', s ? s.to_s : nil)
87:       end

Transfer mode

result::tcp or :udp

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 50
50:       def mode
51:         case attributes['mode']
52:           when 'udp' then :udp
53:           else :tcp
54:         end
55:       end

Set the transfer mode

m::tcp or :udp

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 60
60:       def mode=(m)
61:         case m
62:           when :udp then attributes['mode'] = 'udp'
63:           else attributes['mode'] = 'tcp'
64:         end
65:       end

Session-ID

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 37
37:       def sid
38:         attributes['sid']
39:       end

Set Session-ID

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 43
43:       def sid=(s)
44:         attributes['sid'] = s
45:       end

Get the <streamhost-used/> child

result:[StreamHostUsed]

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 70
70:       def streamhost_used
71:         first_element('streamhost-used')
72:       end

[Source]

    # File lib/xmpp4r/bytestreams/iq/bytestreams.rb, line 25
25:       def typed_add(xe)
26:         if xe.kind_of?(REXML::Element) and xe.name == 'streamhost'
27:           super StreamHost.new.import(xe)
28:         elsif xe.kind_of?(REXML::Element) and xe.name == 'streamhost-used'
29:           super StreamHostUsed.new.import(xe)
30:         else
31:           super xe
32:         end
33:       end

[Validate]