Package twisted :: Package protocols :: Package jabber :: Module component :: Class Service
[frames | no frames]

Class Service

      Accessor --+    
                 |    
     Versioned --+    
                 |    
ApplicationService --+
                     |
                    Service


Business logic superclass for external/connect components

This class provides the necessary functionality to create a new piece of business logic that needs a connection a Jabber router via a connecting TCP socket. Subclass key methods such as (componentConnected, componentDisconnected) to be notified when the component connection comes up and goes down.
Method Summary
  __init__(self, jabberId, serviceParent)
  _connected(self, xs)
  _disconnected(self, obj)
  associateWithRouter(self, password, host, port)
Bind this service to a particular password, host, and port on a router.
  componentConnected(self)
Fired when the component is auth'd with the router
  componentDisconnected(self)
Fired when the component has lost the connection to the router
  configureEvents(self, factory)
Register bootstrap events here
  startService(self)
If you subclass me, you MUST call me
  stopService(self)
If you subclass me, you MUST call me
    Inherited from ApplicationService
  disownServiceParent(self)
Have my parent disown me.
  get_application(self)
  set_application(self, application)
  setApplication(self, application)
  setServiceParent(self, serviceParent)
Set my parent, which must be a service collection of some kind.
  upgradeToVersion1(self)
    Inherited from Accessor
  __delattr__(self, k)
  __getattr__(self, k)
  __setattr__(self, k, v)
  reallyDel(self, k)
*actually* del self.k without incurring side-effects.
  reallySet(self, k, v)
*actually* set self.k to v without incurring side-effects.
    Inherited from Versioned
  __getstate__(self, dict)
Get state, adding a version number to it on its way out.
  __setstate__(self, state)
  versionUpgrade(self)
(internal) Do a version upgrade.

Instance Variable Summary
XmlStream xmlstream: Accessor for the current XmlStream which connects this object to the router

Class Variable Summary
    Inherited from ApplicationService
int persistenceVersion = 1                                                                     
NoneType serviceName = None                                                                  
NoneType serviceParent = None                                                                  
int serviceRunning = 0                                                                     
NoneType serviceType = None                                                                  
    Inherited from Versioned
tuple persistenceForgets = ()

Method Details

__init__(self, jabberId, serviceParent)
(Constructor)

Parameters:
jabberId - Jabber ID of this component (used to login to router)
           (type=str)
Overrides:
twisted.internet.app.ApplicationService.__init__

associateWithRouter(self, password, host, port)

Bind this service to a particular password, host, and port on a router. The component ID used to connect to the router is determined by the jabberId passed in the constructor.
Parameters:
password - Password to use for logging into the router
host - DNS or IP address of the router
port - TCP port on the router to connect to

componentConnected(self)

Fired when the component is auth'd with the router

componentDisconnected(self)

Fired when the component has lost the connection to the router

configureEvents(self, factory)

Register bootstrap events here

startService(self)

If you subclass me, you MUST call me
Overrides:
twisted.internet.app.ApplicationService.startService

stopService(self)

If you subclass me, you MUST call me
Overrides:
twisted.internet.app.ApplicationService.stopService

Instance Variable Details

xmlstream

Accessor for the current XmlStream which connects this object to the router
Type:
XmlStream

Generated by Epydoc 2.0 on Sat Sep 13 04:20:47 2003 http://epydoc.sf.net