
    tf                         d Z ddlmZmZ  G d de          Z G d de          Z G d de          Z G d	 d
e          Z G d de          Z G d de          Z	dS )z
Public Jabber Interfaces.
    )	Attribute	Interfacec                       e Zd ZdZdS )IInitializerz
    Interface for XML stream initializers.

    Initializers perform a step in getting the XML stream ready to be
    used for the exchange of XML stanzas.
    N)__name__
__module____qualname____doc__     e/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/words/protocols/jabber/ijabber.pyr   r      s           r   r   c                   .    e Zd ZdZ ed          Zd ZdS )IInitiatingInitializerzJ
    Interface for XML stream initializers for the initiating entity.
    zThe associated XML streamc                      dS )z
        Initiate the initialization step.

        May return a deferred when the initialization is done asynchronously.
        Nr   r   r   r   
initializez!IInitiatingInitializer.initialize         r   N)r   r   r	   r
   r   	xmlstreamr   r   r   r   r   r      s?          	9::I    r   r   c                   (    e Zd ZdZ ed          ZdS )IIQResponseTrackera  
    IQ response tracker interface.

    The XMPP stanza C{iq} has a request-response nature that fits
    naturally with deferreds. You send out a request and when the response
    comes back a deferred is fired.

    The L{twisted.words.protocols.jabber.client.IQ} class implements a C{send}
    method that returns a deferred. This deferred is put in a dictionary that
    is kept in an L{XmlStream} object, keyed by the request stanzas C{id}
    attribute.

    An object providing this interface (usually an instance of L{XmlStream}),
    keeps the said dictionary and sets observers on the iq stanzas of type
    C{result} and C{error} and lets the callback fire the associated deferred.
    z2Dictionary of deferreds waiting for an iq responseN)r   r   r	   r
   r   iqDeferredsr   r   r   r   r   #   s*         " )STTKKKr   r   c                   b    e Zd ZdZ ed          Z ed          Zd Zd Zd Z	d Z
d Zd	 Zd
S )IXMPPHandlerz
    Interface for XMPP protocol handlers.

    Objects that provide this interface can be added to a stream manager to
    handle of (part of) an XMPP extension protocol.
    z#XML stream manager for this handlerzThe managed XML streamc                     dS )za
        Set the parent of the handler.

        @type parent: L{IXMPPHandlerCollection}
        Nr   parents    r   setHandlerParentzIXMPPHandler.setHandlerParentC   r   r   c                     dS )zd
        Remove the parent of the handler.

        @type parent: L{IXMPPHandlerCollection}
        Nr   r   s    r   disownHandlerParentz IXMPPHandler.disownHandlerParentJ   r   r   c                     dS )aj  
        A connection over the underlying transport of the XML stream has been
        established.

        At this point, no traffic has been exchanged over the XML stream
        given in C{xs}.

        This should setup L{xmlstream} and call L{connectionMade}.

        @type xs:
               L{twisted.words.protocols.jabber.xmlstream.XmlStream}
        Nr   xss    r   makeConnectionzIXMPPHandler.makeConnectionQ   r   r   c                      dS )z
        Called after a connection has been established.

        This method can be used to change properties of the XML Stream, its
        authenticator or the stream manager prior to stream initialization
        (including authentication).
        Nr   r   r   r   connectionMadezIXMPPHandler.connectionMade_   r   r   c                      dS )a  
        The XML stream has been initialized.

        At this point, authentication was successful, and XML stanzas can be
        exchanged over the XML stream L{xmlstream}. This method can be
        used to setup observers for incoming stanzas.
        Nr   r   r   r   connectionInitializedz"IXMPPHandler.connectionInitializedh   r   r   c                     dS )z
        The XML stream has been closed.

        Subsequent use of C{parent.send} will result in data being queued
        until a new connection has been established.

        @type reason: L{twisted.python.failure.Failure}
        Nr   )reasons    r   connectionLostzIXMPPHandler.connectionLostq   r   r   N)r   r   r	   r
   r   r   r   r   r   r"   r$   r&   r)   r   r   r   r   r   8   s          Y@AAF	677I              r   r   c                   $    e Zd ZdZd Zd Zd ZdS )IXMPPHandlerCollectionz\
    Collection of handlers.

    Contain several handlers and manage their connection.
    c                      dS )z:
        Get an iterator over all child handlers.
        Nr   r   r   r   __iter__zIXMPPHandlerCollection.__iter__   r   r   c                     dS )zN
        Add a child handler.

        @type handler: L{IXMPPHandler}
        Nr   handlers    r   
addHandlerz!IXMPPHandlerCollection.addHandler   r   r   c                     dS )zQ
        Remove a child handler.

        @type handler: L{IXMPPHandler}
        Nr   r/   s    r   removeHandlerz$IXMPPHandlerCollection.removeHandler   r   r   N)r   r   r	   r
   r-   r1   r3   r   r   r   r+   r+   |   sK           
      r   r+   c                   $    e Zd ZdZd Zd Zd ZdS )IServicez
    External server-side component service interface.

    Services that provide this interface can be added to L{ServiceManager} to
    implement (part of) the functionality of the server-side component.
    c                     dS )ax  
        Parent component has established a connection.

        At this point, authentication was successful, and XML stanzas
        can be exchanged over the XML stream C{xs}. This method can be used
        to setup observers for incoming stanzas.

        @param xs: XML Stream that represents the established connection.
        @type xs: L{xmlstream.XmlStream}
        Nr   r    s    r   componentConnectedzIService.componentConnected   r   r   c                      dS )z
        Parent component has lost the connection to the Jabber server.

        Subsequent use of C{self.parent.send} will result in data being
        queued until a new connection has been established.
        Nr   r   r   r   componentDisconnectedzIService.componentDisconnected   r   r   c                     dS )ay  
        Parent component has established a connection over the underlying
        transport.

        At this point, no traffic has been exchanged over the XML stream. This
        method can be used to change properties of the XML Stream (in C{xs}),
        the service manager or it's authenticator prior to stream
        initialization (including authentication).
        Nr   r    s    r   transportConnectedzIService.transportConnected   r   r   N)r   r   r	   r
   r7   r9   r;   r   r   r   r5   r5      sK         
 
 
  	 	 	 	 	r   r5   N)
r
   zope.interfacer   r   r   r   r   r   r+   r5   r   r   r   <module>r=      s@    0 / / / / / / /    9       \   U U U U U U U U*A A A A A9 A A AH    Y   6% % % % %y % % % % %r   