Current Path : /usr/lib/python2.7/dist-packages/landscape/broker/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/broker/client.pyc |
Tc @ s d d l m Z m Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d YZ d e f d YZ d e f d YZ d S( i( t infot exception( t maybeDeferred( t format_object( t gather_results( t remotet HandlerNotFoundErrorc B s e Z d Z RS( s3 A handler for the given message type was not found.( t __name__t __module__t __doc__( ( ( s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyR s t BrokerClientPluginc B sk e Z d Z d Z e Z d Z d Z d Z d Z e d Z d Z d d Z d Z d Z RS( sT A convenience for writing L{BrokerClient} plugins. This provides a register method which will set up a bunch of reactor handlers in the idiomatic way. If C{run} is defined on subclasses, it will be called every C{run_interval} +seconds after being registered. @cvar run_interval: The interval, in seconds, to execute the C{run} method. If set to C{None}, then C{run} will not be scheduled. @cvar run_immediately: If C{True} the plugin will be run immediately after it is registered. @ivar _session_id: the session id to be passed when sending messages via the broker. This variable is set by the C{register} method and should only need to be renewed when a re-synchronisation request is sent. See L{landscape.broker.server.BrokerServer.send_message} for more details. i c C sQ | | _ | j j j d | j | j j j d | j } | j | j d S( Nt resynchronizet scope( t clientt reactort call_ont _resynchronizet brokert get_session_idR t addCallbackt _got_session_id( t selfR t deferred( ( s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyt register' s c C s | j S( s% An alias for the C{client} attribute.( R ( R ( ( s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyt registry- s c s5 f d } | j j j d | f | d S( sV Register a callback fired upon a C{message-type-acceptance-changed}. c s | r Sd S( N( ( t acceptance( t callablet argst kwargs( s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyt acceptance_changed7 s s message-type-acceptance-changedN( R R R ( R t typeR R R R ( ( R R R s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyt call_on_accepted2 s c C s | d k p | j | k s d S| j d k rG | j j j | j n | j | j j j d | j } | j | j | S( s Handle the 'resynchronize' event. Subclasses should do any clear-down operations specific to their state within an implementation of the L{_reset} method. NR ( t NoneR t _loopR R t cancel_callt _resetR R R R ( R t scopesR ( ( s; /usr/lib/python2.7/dist-packages/landscape/broker/client.pyR >