Package pyxmpp :: Package jabber :: Module disco :: Class DiscoCacheFetcherBase
[show private | hide private]
[frames | no frames]

Class DiscoCacheFetcherBase

CacheFetcher --+
               |
              DiscoCacheFetcherBase


Base class for disco cache fetchers.
Method Summary
  fetch(self)
Initialize the Service Discovery process.
  __error(self, stanza)
Handle disco error response.
  __response(self, stanza)
Handle successful disco response.
  __timeout(self, stanza)
Handle disco timeout.
    Inherited from CacheFetcher
  __init__(self, cache, address, item_freshness_period, item_expiration_period, item_purge_period, object_handler, error_handler, timeout_handler, timeout_period, backup_state)
Initialize an CacheFetcher object.
  error(self, error_data)
Handle a retrieval error and call apriopriate handler.
  got_it(self, value, state)
Handle a successfull retrieval and call apriopriate handler.
  timeout(self)
Handle fetcher timeout and call apriopriate handler.
  _deactivate(self)
Remove the fetcher from cache and mark it not active.
  _deactivated(self)
Mark the fetcher inactive after it is removed from the cache.
bool _try_backup_item(self)
Check if a backup item is available in cache and call the item handler if it is.

Instance Variable Summary
    Inherited from CacheFetcher
bool active: True as long as the fetcher is active and requestor expects one of the handlers to be called.
any hashable address: requested item address.
Cache cache: cache object which created this fetcher.
datetime timeout_time: timeout time.

Class Variable Summary
classobj disco_class: disco class to be used (DiscoInfo or DiscoItems).
pyxmpp.stream.Stream stream: stream used by the fetcher.

Method Details

fetch(self)

Initialize the Service Discovery process.
Overrides:
pyxmpp.cache.CacheFetcher.fetch

__error(self, stanza)

Handle disco error response.
Parameters:
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

__response(self, stanza)

Handle successful disco response.
Parameters:
stanza - the stanza received.
           (type=pyxmpp.stanza.Stanza)

__timeout(self, stanza)

Handle disco timeout.

Class Variable Details

disco_class

disco class to be used (DiscoInfo or DiscoItems).
Type:
classobj
Value:
None                                                                  

stream

stream used by the fetcher.
Type:
pyxmpp.stream.Stream
Value:
None