ϪfdZddlmZddlmZddlmZddlmZm Z ddl m Z m Z ddl mZmZddlmZdd lmZmZmZdd lmZmZmZdd lmZmZdd lmZmZm Z m!Z! dd l m"Z#e#jHsdZ"ne#Z" edZ&edZ'dZ(dZ)e*Z+dZ,GddZ-Gdde-Z.Gdde-Z/Gdde0Z1e ejdGddZ3Gdde0Z4Gd d!e4Z5Gd"d#e4Z6Gd$d%e4Z7Gd&d'e3Z8Gd(d)ejrZ9Gd*d+ejtZ:Gd,d-ejvejxZ=Gd.d/e0Z>d0Z?Gd1d2ejZAd;d3ZBe ejGd4d5ZDe ejGd6d7ZFGd8d9eFZGgd:ZHy#e%$rdZ"YhwxYw)eZdZUdZdZeeed<dZdZ dZ dZ y)ConnectAuthenticatorz0 Authenticator for initiating entities. N namespacec||_yr)) otherHost)r,rIs r#r-zConnectAuthenticator.__init__s "r%c|j|j_tj|j|j_|jj yr))rGrr internJIDrI otherEntity sendHeaderr+s r#r0z#ConnectAuthenticator.connectionMades;#'>> %(]]4>>%B" !!#r%cfdfdtjd}|j|jjj t y)a Perform stream initialization procedures. An L{XmlStream} holds a list of initializer objects in its C{initializers} attribute. This method calls these initializers in order and dispatches the L{STREAM_AUTHD_EVENT} event when the list has been successfully processed. Otherwise it dispatches the C{INIT_FAILED_EVENT} event with the failure. Initializers may return the special L{Reset} object to halt the initialization processing. It signals that the current initializer was successfully processed, but that the XML Stream has been reset. An example is the TLSInitiatingInitializer. cRjjjd|S)Nr)r initializerspop)resultr,s r# remove_firstz;ConnectAuthenticator.initializeStream..remove_firsts NN ' ' + +A .Mr%cB|tury jjd}tj|j }|j |j |S#t$r-jjjtYywxYw)z Take the first initializer and process it. On success, the initializer is removed from the list and then next initializer will be tried. Nr) ResetrrPr maybeDeferred initialize addCallbackr9dispatchSTREAM_AUTHD_EVENT)rRinitddo_nextrSr,s r#r]z6ConnectAuthenticator.initializeStream..do_nexts ~~2215 ''8 l+ g& ''8JK sA((3BBN)r succeedrX addErrbackrrYINIT_FAILED_EVENT)r,r\r]rSs` @@r#initializeStreamz%ConnectAuthenticator.initializeStreamsB    , MM$  g T^^,,.?@r%ctj||jdj_|j dr't j|dj_jjdk\r)fd}jjdtz|yjy)a Called by the XmlStream when the stream has started. This extends L{Authenticator.streamStarted} to extract further stream headers from C{rootElement}, optionally wait for stream features being received and then call C{initializeStream}. idfromr5rci}|jD]}|||j|jf<|j_j yr))elementsurinamerfeaturesra)elementrjfeaturer,s r# onFeaturesz6ConnectAuthenticator.streamStarted..onFeaturessS&//1DG> ! !V + ( NN - -(:5z   ! ! #r%) rArBrCrDrGrr__annotations__r-r0rar=r/r%r#rFrFs- $Ix}##$ -A^$r%rFc2eZdZUdZdZeeed<dZdZ y)ListenAuthenticatorz/ Authenticator for receiving entities. NrGcRtj||d|j_y)z Called by the XmlStreamFactory when a connection has been made. Extend L{Authenticator.associateWithStream} to set the L{XmlStream} to be non-initiating. FN)r'r@r initiatingr?s r#r@z'ListenAuthenticator.associateWithStream s  ))$ :$)!r%ctj|||j|j_|j dr't j|d|j_i|j_ |jjD]\}}||jj|< ttjdjd|j_y)z Called by the XmlStream when the stream has started. This extends L{Authenticator.streamStarted} to extract further information from the stream headers from C{rootElement}. toasciiN)r'r= defaultUrirrGr6rrK thisEntityprefixes localPrefixesitemsrr secureRandomdecoder )r,r<prefixrhs r#r=z!ListenAuthenticator.streamStarteds ##D+6#.#9#9  # #D )(+ k$6G(HDNN %"$&44::< 2KFC+1DNN # #C ( 2%Y%;%;A%>?FFwOr%) rArBrCrDrGrrrqr@r=r/r%r#rsrss" $Ix}#*Pr%rsceZdZdZy)FeatureNotAdvertizedzp Exception indicating a stream feature was not advertized, while required by the initiating entity. NrArBrCrDr/r%r#rr*r%rcDeZdZUdZdZeeeefed<ddZ dZ dZ y) BaseFeatureInitiatingInitializera Base class for initializers with a stream feature. This assumes the associated XmlStream represents the initiating entity of the connection. @cvar feature: tuple of (uri, name) of the stream feature root element. @type feature: tuple of (C{str}, C{str}) @ivar required: whether the stream feature is required to be advertized by the receiving entity. @type required: C{bool} Nrlc ||_||_yr))rrequired)r,xsrs r#r-z)BaseFeatureInitiatingInitializer.__init__Cs  r%c|j|jjvr|jS|jrt y)a_ Initiate the initialization. Checks if the receiving entity advertizes the stream feature. If it does, the initialization is started. If it is not advertized, and the C{required} instance variable is C{True}, it raises L{FeatureNotAdvertized}. Otherwise, the initialization silently succeeds. N)rlrrjstartrrr+s r#rWz+BaseFeatureInitiatingInitializer.initializeGs6 <<4>>22 2::<  ]]& &r%cy)zr Start the actual initialization. May return a deferred for asynchronous initialization. Nr/r+s r#rz&BaseFeatureInitiatingInitializer.startYr1r%)F) rArBrCrDrlrrrrqr-rWrr/r%r#rr1s/ *.GXeCHo &-!$ r%rceZdZdZy)TLSErrorz TLS base exception. Nrr/r%r#rrar%rceZdZdZy) TLSFailedz5 Exception indicating failed TLS negotiation Nrr/r%r#rrgrr%rceZdZdZy) TLSRequiredz Exception indicating required TLS negotiation. This exception is raised when the receiving entity requires TLS negotiation and the initiating does not desire to negotiate TLS. Nrr/r%r#rrmr%rceZdZdZy)TLSNotSupportedz Exception indicating missing TLS support. This exception is raised when the initiating entity wants and requires to negotiate TLS when the OpenSSL library is not available. Nrr/r%r#rrvrr%rcJeZdZdZedfZdZdZdZd fd Z dZ dZ dZ xZ S) TLSInitiatingInitializera  TLS stream initializer for the initiating entity. It is strongly required to include this initializer in the list of initializers for an XMPP stream. By default it will try to negotiate TLS. An XMPP server may indicate that TLS is required. If TLS is not desired, set the C{wanted} attribute to False instead of removing it from the list of initializers, so a proper exception L{TLSRequired} can be raised. @ivar wanted: indicates if TLS negotiation is wanted. @type wanted: C{bool} starttlsTNc6t|||||_y)a4 @param configurationForTLS: An object which creates appropriately configured TLS connections. This is passed to C{startTLS} on the transport and is preferably created using L{twisted.internet.ssl.optionsForClientTLS}. If C{None}, the default is to verify the server certificate against the trust roots as provided by the platform. See L{twisted.internet._sslverify.platformTrust}. @type configurationForTLS: L{IOpenSSLClientConnectionCreator} or C{None} )rN)superr-_configurationForTLS)r,rrconfigurationForTLS __class__s r#r-z!TLSInitiatingInitializer.__init__s h/$7!r%c|jjd|j|jr |j}n3tj |jj j}|jjj||jj|jj|jjty)zH Proceed with TLS negotiation and reset the XML stream. /failureN)rremoveObserver onFailurerroptionsForClientTLSrLhost transportstartTLSresetrM _deferredcallbackrU)r,objctxs r# onProceedz"TLSInitiatingInitializer.onProceeds %%j$..A  $ $++C))$..*D*D*I*IJC   ))#.  !!# &r%c|jjd|j|jj t y)N/proceed)rrrrerrbackrr,rs r#rz"TLSInitiatingInitializer.onFailures. %%j$..A y{+r%c|jrEt>|jrtjt Stj dSn_|jj|jjrtjtStj dStj|_ |jjd|j|jjd|j|jj!t#j$t&df|jS)a Start TLS negotiation. This checks if the receiving entity requires TLS, the SSL library is available and uses the C{required} and C{wanted} instance variables to determine what to do in the various different cases. For example, if the SSL library is not available, and wanted and required by the user, it raises an exception. However if it is not required by both parties, initialization silently succeeds, moving on to the next step. Nrrr)wantedrrr failrr^rrjrlrDeferredrrorrsendrElement NS_XMPP_TLSr+s r#rzTLSInitiatingInitializer.starts ;;{== ::o&788 ==.. ^^ $ $T\\ 2 ; ;::km, ,==& &) ))*dnnE ))*dnnE FNNK+DEF~~r%)TN)rArBrCrDrrlrrrr-rrr __classcell__)rs@r#rrs8 J'G FI 8 ',r%rcheZdZdZdZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZdZdZdZy) XmlStreama} XMPP XML Stream protocol handler. @ivar version: XML stream version as a tuple (major, minor). Initially, this is set to the minimally supported version. Upon receiving the stream header of the peer, it is set to the minimum of that value and the version on the received header. @type version: (C{int}, C{int}) @ivar namespace: default namespace URI for stream @type namespace: C{unicode} @ivar thisEntity: JID of this entity @type thisEntity: L{JID} @ivar otherEntity: JID of the peer entity @type otherEntity: L{JID} @ivar sid: session identifier @type sid: C{unicode} @ivar initiating: True if this is the initiating stream @type initiating: C{bool} @ivar features: map of (uri, name) to stream features element received from the receiving entity. @type features: C{dict} of (C{unicode}, C{unicode}) to L{domish.Element}. @ivar prefixes: map of URI to prefixes that are to appear on stream header. @type prefixes: C{dict} of C{unicode} to C{unicode} @ivar initializers: list of stream initializer objects @type initializers: C{list} of objects that provide L{IInitializer} @ivar authenticator: associated authenticator that uses C{initializers} to initialize the XML stream. reinvalidNTFctjj|tdi|_||_g|_i|_|j|y)Nstream) rrr-rpr| authenticatorrPrjr@r,rs r#r-zXmlStream.__init__sI$$T*#X. *  ))$/r%c2ddlm}|j|i|S)Nr)reactor)twisted.internetr callLater)r,argskwargsrs r# _callLaterzXmlStream._callLater s, w  $1&11r%c2d|_|jy)z Reset XML Stream. Resets the XML Parser for incoming data. This is to be used after successfully negotiating a new layer, e.g. TLS and SASL. Note that registered event observers will continue to be in place. FN) _headerSent_initializeStreamr+s r#rzXmlStream.resets!  r%c|jtjtj|t |j jy)a- Called when a stream:error element has been received. Dispatches a L{STREAM_ERROR_EVENT} event with the error element to allow for cleanup actions and drops the connection. @param errelem: The received error element. @type errelem: L{domish.Element} N)rYr FailurerexceptionFromStreamErrorrrloseConnection)r,errelems r# onStreamErrorzXmlStream.onStreamErrors< OOE::7C DFX  %%'r%cTi}|jjD]\}}|tk7s|||<tjtdf|j |}|j r|j j|d<|jr|jj|d<|js|jr|j|d<|jdk\rd|jz|d<|j|j|jd d |_y ) z% Send stream header. r)r}rwrdrcrez%d.%dr3r)r| closeElementTN)r|r~rprrrGrLuserhostr{rur r3rtoXmlr)r,r}rhrr<s r#rMzXmlStream.sendHeader(s  ==..0 ,KCj (+ f% ,nn  "DNN-     $ 0 0 9 9 ;K  ??"&//":":"N)rr+s r# sendFooterzXmlStream.sendFooterEs $%r%c|js|js|j|jr/|j|j |j |j jy)a^ Send stream level error. If we are the receiving entity, and haven't sent the header yet, we sent one first. After sending the stream error, the stream is closed and the transport connection dropped. @param streamError: stream error instance @type streamError: L{error.StreamError} N)rrurMr getElementrrr)r, streamErrors r#sendStreamErrorzXmlStream.sendStreamErrorKsU OO     IIk,,. / OO  %%'r%ctjj|rI|j|j|j t |jj}tjj||y)aV Send data over the stream. This overrides L{xmlstream.XmlStream.send} to use the default namespace of the stream header when serializing L{domish.IElement}s. It is assumed that if you pass an object that provides L{domish.IElement}, it represents a direct child of the stream's root element. )r|rzprefixesInScopeN) rIElement providedByrr|rGlistvaluesrrrrs r#rzXmlStream.sendasd ?? % %c *))>> $T]]%9%9%; <C   s+r%cvtjj||jjy)zx Called when a connection is made. Notifies the authenticator when a connection has been made. N)rrr0rr+s r#r0zXmlStream.connectionMadess* **40 ))+r%ctjj|||jdtz|j |j j|y)a Called when the stream header has been received. Extracts the header's C{id} and C{version} attributes from the root element. The C{id} attribute is stored in our C{sid} attribute and the C{version} attribute is parsed and the minimum of the version we sent and the parsed C{version} attribute is stored as a tuple (major, minor) in this class' C{version} attribute. If no C{version} attribute was present, we assume version 0.0. If appropriate (we are the initiating stream and the minimum of our and the other party's version is at least 1.0), a one-time observer is registered for getting the stream features. The registered function is C{onFeatures}. Ultimately, the authenticator's C{streamStarted} method will be called. @param rootElement: The root element. @type rootElement: L{domish.Element} z/error[@xmlns='%s']N)rronDocumentStartrorprrr=)r,r<s r#rzXmlStream.onDocumentStart|sL* ++D+>  5 BDDVDVW ((5r%)rArBrCrDr3rGr{rLr rurr-rrrrMrrrr0rr/r%r#rrs^>GIJK CJK 02 ! ( :& (,,$,6r%rceZdZdZeZdZy)XmlStreamFactoryz Factory for Jabber XmlStream objects as a reconnecting client. Note that this differs from L{xmlstream.XmlStreamFactory} in that it generates Jabber specific L{XmlStream} instances that have authenticators. cRtjj||||_yr))rrr-rrs r#r-zXmlStreamFactory.__init__s ""++D-@*r%N)rArBrCrDrr r-r/r%r#rrsH+r%rc eZdZdZeZdZdZy)XmlStreamServerFactorya Factory for Jabber XmlStream objects as a server. @since: 8.2. @ivar authenticatorFactory: Factory callable that takes no arguments, to create a fresh authenticator to be associated with the XmlStream. cPtjj|||_yr))rBootstrapMixinr-authenticatorFactory)r,rs r#r-zXmlStreamServerFactory.__init__s  ))$/$8!r%cx|j}|j|}||_|j||S)z Create an instance of XmlStream. A new authenticator instance will be created and passed to the new XmlStream. Registered bootstrap event observers are installed as well. )rr factoryinstallBootstraps)r,addrrrs r# buildProtocolz$XmlStreamServerFactory.buildProtocols:113 ]]= )  r" r%N)rArBrCrDrr r-rr/r%r#rrsH9 r%rceZdZdZy) TimeoutErrorzc Exception raised when no IQ response has been received before the configured timeout. Nrr/r%r#rrrr%rcfd}fd}i_tdd_jtj |jd|jd|t tjy)a0 Enhances an XmlStream for iq response tracking. This makes an L{XmlStream} object provide L{IIQResponseTracker}. When a response is an error iq stanza, the deferred has its errback invoked with a failure that holds a L{StanzaError} that is easier to examine. ct|ddry j|d}j|d=d|_|ddk(r%|jt j |y|j |y#t$rYywxYw)zC Handle iq response by firing associated deferred. handledFNrcTtyper)getattr iqDeferredsrrrexceptionFromStanzarKeyError)iqr\rs r#rz.upgradeWithIQResponseTracker..callbacks 2y% (  r$x(Ar$x(BJ&zW$ %33B78 2   sA99 BBcj}i_|jD]}|jty)z Make sure deferreds do not linger on after disconnect. This errbacks all deferreds of iq's for which no response has been received with a L{ConnectionLost} failure. Otherwise, the deferreds will never be fired. N)rrrr )_rr\rs r# disconnectedz2upgradeWithIQResponseTracker..disconnecteds<nn ##% (A IIn& ' (r%iqDefaultTimeoutNz/iq[@type="result"]z/iq[@type="error"]) rrr addObserverrrrrIIQResponseTracker)rrrs` r#upgradeWithIQResponseTrackerrsj& (BN!"&8$?BNN9--|<NN((3NN'2R334r%c$eZdZdZdZddZddZy)IQa Wrapper for an iq stanza. Iq stanzas are used for communications with a request-response behaviour. Each iq request is associated with an XML stream and has its own unique id to be able to track the response. @ivar timeout: if set, a timeout period after which the deferred returned by C{send} will have its errback called with a L{TimeoutError} failure. @type timeout: C{float} Nc|tjj|d|j||d<||_y)z @type xmlstream: L{xmlstream.XmlStream} @param xmlstream: XmlStream to use for transmission of this IQ @type stanzaType: C{str} @param stanzaType: IQ type identifier ('get' or 'set') )NrrN)rrr- addUniqueId _xmlstream)r,r stanzaTypes r#r-z IQ.__init__s4 l3 !V #r%c||d<tjjjst jt j jjd<jxsjj}|8fd}jj||fd}j|jjS)a Send out this iq. Returns a deferred that is fired when an iq response with the same id is received. Result responses will be passed to the deferred callback. Error responses will be transformed into a L{StanzaError} and result in the errback of the deferred being invoked. @rtype: L{defer.Deferred} rwrccnjjd=jtdy)Nrcz IQ timed out)rrrr)r\r,sr# onTimeoutzIQ.send..onTimeout6s*OO//T ; ,~67r%cHjrj|Sr))activecancel)rRcalls r# cancelTimeoutzIQ.send..cancelTimeout<s;;=KKM r%) rrrrrr rrtimeoutrraddBothr)r,rwrr rrr\s` @@r#rzIQ.sends >DJ))44T__E ( 9 NN 23##DJ/,,B$//"B"B   8??--gyAD  IIm $ T"r%)setr))rArBrCrDrr-rr/r%r#rrs G $'r%rc|jd}|jd}|jd}tjd|jf}|r||d<|r||d<|r||d<|r||d<|S)a Create a response stanza from another stanza. This takes the addressing and id attributes from a stanza to create a (new, empty) response stanza. The addressing attributes are swapped and the id copied. Optionally, the stanza type of the response can be specified. @param stanza: the original stanza @type stanza: L{domish.Element} @param stanzaType: optional response stanza type @type stanzaType: C{str} @return: the response stanza. @rtype: L{domish.Element} rdrwrcNr)rnrrri)stanzartoAddrfromAddrstanzaIDresponses r# toResponserHs   (F""4(H""4(H~~tV[[12H #!% Or%c@eZdZdZdZdZdZdZdZdZ dZ d Z y ) XMPPHandlerz XMPP protocol handler. Classes derived from this class implement (part of) one or more XMPP extension protocols, and are referred to as a subprotocol implementation. c d|_d|_yr))parentrr+s r#r-zXMPPHandler.__init__rs r%cH||_|jj|yr))r addHandlerr,rs r#setHandlerParentzXMPPHandler.setHandlerParentvs  t$r%cH|jj|d|_yr))r removeHandlerr!s r#disownHandlerParentzXMPPHandler.disownHandlerParentzs !!$' r%c2||_|jyr))rr0)r,rs r#makeConnectionzXMPPHandler.makeConnection~s r%cy)z Called after a connection has been established. Can be overridden to perform work before stream initialization. Nr/r+s r#r0zXMPPHandler.connectionMader1r%cy)z The XML stream has been initialized. Can be overridden to perform work after stream initialization, e.g. to set up observers and start exchanging XML stanzas. Nr/r+s r#connectionInitializedz!XMPPHandler.connectionInitializedr1r%cd|_y)z The XML stream has been closed. This method can be extended to inspect the C{reason} argument and act on it. Nr*r,reasons r#connectionLostzXMPPHandler.connectionLosts r%c:|jj|y)a Send data over the managed XML stream. @note: The stream manager maintains a queue for data sent using this method when there is no current initialized XML stream. This data is then sent as soon as a new stream has been established and initialized. Subsequently, L{connectionInitialized} will be called again. If this queueing is not desired, use C{send} on C{self.xmlstream}. @param obj: data to be sent over the XML stream. This is usually an object providing L{domish.IElement}, or serialized XML. See L{xmlstream.XmlStream} for details. N)rrrs r#rzXMPPHandler.sends r%N) rArBrCrDr-r"r%r'r0r*r.rr/r%r#rris/%  r%rc(eZdZdZdZdZdZdZy)XMPPHandlerCollectiona3 Collection of XMPP subprotocol handlers. This allows for grouping of subprotocol handlers, but is not an L{XMPPHandler} itself, so this is not recursive. @ivar handlers: List of protocol handlers. @type handlers: C{list} of objects providing L{IXMPPHandler} cg|_yr))handlersr+s r#r-zXMPPHandlerCollection.__init__s  r%c,t|jS)z2 Act as a container for handlers. )iterr3r+s r#__iter__zXMPPHandlerCollection.__iter__sDMM""r%c:|jj|y)zs Add protocol handler. Protocol handlers are expected to provide L{ijabber.IXMPPHandler}. N)r3appendr,handlers r#r z XMPPHandlerCollection.addHandlers W%r%c:|jj|y)z* Remove protocol handler. N)r3remover9s r#r$z#XMPPHandlerCollection.removeHandlers W%r%N)rArBrCrDr-r6r r$r/r%r#r1r1s # &&r%r1c>eZdZdZdZdZdZdZdZdZ dZ d Z y ) StreamManagera, Business logic representing a managed XMPP connection. This maintains a single XMPP connection and provides facilities for packet routing and transmission. Business logic modules are objects providing L{ijabber.IXMPPHandler} (like subclasses of L{XMPPHandler}), and added using L{addHandler}. @ivar xmlstream: currently managed XML stream @type xmlstream: L{XmlStream} @ivar logTraffic: if true, log all traffic. @type logTraffic: C{bool} @ivar _initialized: Whether the stream represented by L{xmlstream} has been initialized. This is used when caching outgoing stanzas. @type _initialized: C{bool} @ivar _packetQueue: internal buffer of unsent data. See L{send} for details. @type _packetQueue: C{list} Fcftj|d|_g|_d|_|j t |j|j t|j|j t|j|j t|j||_y)NF)r1r-r _packetQueue _initialized addBootstrapr _connectedrZ_authdr`initializationFailedr _disconnectedr)r,rs r#r-zStreamManager.__init__s&&t,!3T__E/=.0I0IJ-t/A/AB r%ctj|||jr9|jr,|j |j|j yyy)z Add protocol handler. When an XML stream has already been established, the handler's C{connectionInitialized} will be called to get it up to speed. N)r1r rrAr'r*r9s r#r zStreamManager.addHandlersJ ((w7 >>d//  " "4>> 2  ) ) +0>r%cd}d}|jr||_||_||_|D]}|j |y)z Called when the transport connection has been established. Here we optionally set up traffic logging (depending on L{logTraffic}) and call each handler's C{makeConnection} method with the L{XmlStream} instance. c4tjd|zy)NzRECV: %rrmsgbufs r# logDataInz+StreamManager._connected..logDataIn  GGJ$ %r%c4tjd|zy)NzSEND: %rrJrLs r# logDataOutz,StreamManager._connected..logDataOutrOr%N) logTraffic rawDataInFn rawDataOutFnrr')r,rrNrQes r#rCzStreamManager._connectedsG & & ??&BN(BO !A  R  !r%c|jD]}|j|g|_d|_|D]}|jy)z Called when the stream has been initialized. Send out cached stanzas and call each handler's C{connectionInitialized} method. TN)r@rrAr*)r,rprUs r#rDzStreamManager._authdsQ"" A GGAJ   &A # # % &r%cy)a Called when stream initialization has failed. Stream initialization has halted, with the reason indicated by C{reason}. It may be retried by calling the authenticator's C{initializeStream}. See the respective authenticators for details. @param reason: A failure instance indicating why stream initialization failed. @type reason: L{failure.Failure} Nr/r,s r#rEz"StreamManager.initializationFailed-r1r%cPd|_d|_|D]}|j|y)a Called when the stream has been closed. From this point on, the manager doesn't interact with the L{XmlStream} anymore and notifies each handler that the connection was lost by calling its C{connectionLost} method. NF)rrAr.)r,r-rUs r#rFzStreamManager._disconnected:s2! %A  V $ %r%c|jr|jj|y|jj |y)aA Send data over the XML stream. When there is no established XML stream, the data is queued and sent out when a new XML stream has been established and initialized. @param obj: data to be sent over the XML stream. See L{xmlstream.XmlStream.send} for details. N)rArrr@r8rs r#rzStreamManager.sendJs3    NN   $    $ $S )r%N) rArBrCrDrRr-r rCrDrErFrr/r%r#r>r>s1(J  ,!0&$  % *r%r>)r'rrFrr`rrsrprrUrZrrrrr>rrrrrrrr1rrrr$rrr))IrDbinasciirhashlibrsysrtypingrrzope.interfacerr rr r twisted.internet.errorr twisted.pythonr rrtwisted.words.protocols.jabberrrrtwisted.words.xishrrtwisted.words.xish.xmlstreamrrrrr_ssl supported ImportErrorrZr`rprobjectrUr$r'rFrs ExceptionrIInitiatingInitializerrrrrrrrrr ServerFactoryrrrrrr IXMPPHandlerrIXMPPHandlerCollectionr1r>__all__r/r%r#ros ("8,122>>0, >>2345 / / 3"P#P#f]$=]$@#P-#PL9 W + +,, , -, ^y  (hS?SlA6 ##A6H +y11 + Y55x7M7M>9/5dDDNB W ! !"??#?D W + +,!&!&-!&HF*)F*R W! CsGGG