~ubuntu-branches/ubuntu/lucid/landscape-client/lucid-updates

« back to all changes in this revision

Viewing changes to landscape/broker/service.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2012-04-10 14:28:48 UTC
  • mfrom: (1.1.27)
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: package-import@ubuntu.com-20120410142848-7xsy4g2xii7y7ntc
ImportĀ upstreamĀ versionĀ 12.04.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from landscape.service import LandscapeService, run_landscape_service
6
6
from landscape.broker.registration import RegistrationHandler, Identity
7
7
from landscape.broker.config import BrokerConfiguration
8
 
from landscape.broker.transport import HTTPTransport, PayloadRecorder
 
8
from landscape.broker.transport import HTTPTransport
9
9
from landscape.broker.exchange import MessageExchange
10
10
from landscape.broker.exchangestore import ExchangeStore
11
11
from landscape.broker.ping import Pinger
35
35
    @ivar pinger: The L{Pinger} checks if the server has new messages for us.
36
36
    @ivar registration: The L{RegistrationHandler} performs the initial
37
37
        registration.
 
38
 
 
39
    @param config: A L{BrokerConfiguration}.
38
40
    """
39
41
 
40
42
    transport_factory = HTTPTransport
42
44
    service_name = BrokerServer.name
43
45
 
44
46
    def __init__(self, config):
45
 
        """
46
 
        @param config: A L{BrokerConfiguration}.
47
 
        """
48
47
        self.persist_filename = os.path.join(
49
48
            config.data_path, "%s.bpickle" % (self.service_name,))
50
49
        super(BrokerService, self).__init__(config)
51
50
 
52
 
        if config.record is not None:
53
 
            self.payload_recorder = PayloadRecorder(config.record_directory)
54
 
        else:
55
 
            self.payload_recorder = None
56
51
        self.transport = self.transport_factory(
57
 
            config.url, config.ssl_public_key, self.payload_recorder)
 
52
            self.reactor, config.url, config.ssl_public_key)
58
53
        self.message_store = get_default_message_store(
59
54
            self.persist, config.message_store_path)
60
55
        self.identity = Identity(self.config, self.persist)
62
57
        self.exchanger = MessageExchange(
63
58
            self.reactor, self.message_store, self.transport, self.identity,
64
59
            exchange_store, config)
65
 
        self.pinger = self.pinger_factory(self.reactor, config.ping_url,
66
 
                                          self.identity, self.exchanger)
 
60
        self.pinger = self.pinger_factory(
 
61
            self.reactor, config.ping_url, self.identity, self.exchanger,
 
62
            interval=config.ping_interval)
67
63
        self.registration = RegistrationHandler(
68
64
            config, self.identity, self.reactor, self.exchanger, self.pinger,
69
65
            self.message_store, fetch_async)