Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/broker/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/broker/service.pyc

ó
ÍÿŠTc@sádZddlZddlmZmZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZd
efd„ƒYZd„ZdS(s Deployment code for the monitor.iÿÿÿÿN(tLandscapeServicetrun_landscape_service(tComponentPublisher(tRegistrationHandlertIdentity(tBrokerConfiguration(t
HTTPTransport(tMessageExchange(t
ExchangeStore(tPinger(tget_default_message_store(tBrokerServert
BrokerServicecBs>eZdZeZeZejZ	d„Z
d„Zd„ZRS(s"The core C{Service} of the Landscape Broker C{Application}.

    The Landscape broker service handles all the communication between the
    client and server.  When started it creates and runs all necessary
    components to exchange messages with the Landscape server.

    @cvar service_name: C{broker}

    @ivar persist_filename: Path to broker-specific persistent data.
    @ivar persist: A L{Persist} object saving and loading data from
        C{self.persist_filename}.
    @ivar message_store: A L{MessageStore} used by the C{exchanger} to
        queue outgoing messages.
    @ivar transport: An L{HTTPTransport} used by the C{exchanger} to deliver
        messages.
    @ivar identity: The L{Identity} of the Landscape client the broker runs on.
    @ivar exchanger: The L{MessageExchange} exchanges messages with the server.
    @ivar pinger: The L{Pinger} checks if the server has new messages for us.
    @ivar registration: The L{RegistrationHandler} performs the initial
        registration.

    @param config: A L{BrokerConfiguration}.
    cCsktjj|jd|jfƒ|_tt|ƒj|ƒ|j	|j
|j|jƒ|_
t|j|jƒ|_t|j|jƒ|_t|jjƒ}t|j
|j|j
|j||ƒ|_|j|j
|j|j|ƒ|_t||j|j
|j|j|jƒ|_t|j|j
|j|j|j|jƒ|_t|j|j
|jƒ|_ dS(Ns
%s.bpickle(!tostpathtjoint	data_pathtservice_nametpersist_filenametsuperRt__init__ttransport_factorytreactorturltssl_public_keyt	transportR
tpersisttmessage_store_patht
message_storeRtconfigtidentityRtexchange_store_pathRt	exchangertpinger_factorytpingerRtregistrationRtbrokerRt	publisher(tselfRtexchange_store((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pyR.s,	cCs>tt|ƒjƒ|jjƒ|jjƒ|jjƒdS(sâStart the broker.

        Create a L{BrokerServer} listening on C{broker_socket_path} for clients
        connecting with the L{BrokerServerConnector}, and start the
        L{MessageExchange} and L{Pinger} services.
        N(RRtstartServiceR%tstartR R"(R&((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pyR(Gs

cCs>|jjƒ|jjƒ|jjƒtt|ƒjƒdS(sStop the broker.N(R%tstopR R"RRtstopService(R&((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pyR+Ss


(
t__name__t
__module__t__doc__RRR	R!RtnameRRR(R+(((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pyRs			cCsttt|ƒdS(s7Run the application, given some command line arguments.N(RRR(targs((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pytrun[s(R.R
tlandscape.serviceRRt
landscape.ampRtlandscape.broker.registrationRRtlandscape.broker.configRtlandscape.broker.transportRtlandscape.broker.exchangeRtlandscape.broker.exchangestoreRtlandscape.broker.pingR	tlandscape.broker.storeR
tlandscape.broker.serverRRR1(((s</usr/lib/python2.7/dist-packages/landscape/broker/service.pyt<module>sJ