Package flumotion :: Package manager :: Module worker :: Class WorkerAvatar
[show private | hide private]
[frames | no frames]

Class WorkerAvatar

   Avatar --+    
            |    
 Loggable --+    
            |    
ManagerAvatar --+
                |
               WorkerAvatar


I am an avatar created for a worker. A reference to me is given when logging in and requesting a worker avatar. I live in the manager.
Method Summary
  attached(self, *args, **kwargs)
  createComponent(self, avatarId, type, config)
Create a component of the given type with the given config.
  detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
  getName(self)
  perspective_componentAddMessage(self, avatarId, message)
Called by the worker to tell the manager to add a given message to the given component.
  releasePorts(self, ports)
Release the given list of ports on the worker.
  reservePorts(self, numPorts)
Reserve the given number of ports on the worker.
    Inherited from ManagerAvatar
  __init__(self, heaven, avatarId)
str or None getClientAddress(self)
Get the IPv4 address of the machine the PB client is connecting from, as seen from the avatar.
bool hasRemoteReference(self)
Check if the avatar has a remote reference to the peer.
  mindCallRemote(self, name, *args, **kwargs)
Call the given remote method.
list of tuple of (str, str) perspective_getBundleSums(self, bundleName, fileName, moduleName)
Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
list of (str, str) tuples perspective_getBundleSumsByFile(self, filename)
Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
dict of str -> str perspective_getBundleZips(self, bundles)
Get the zip files for the given list of bundles.
    Inherited from Avatar
  perspectiveMessageReceived(self, broker, message, args, kw)
This method is called when a network message is received.
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, message)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure)
Log a warning about a Failure.

Instance Variable Summary
    Inherited from ManagerAvatar
str avatarId: the id for this avatar, unique inside the heaven
flumotion.manager.base.ManagerHeaven heaven: the heaven this avatar is part of
twisted.spread.pb.RemoteReference mind: a remote reference to the client-side Medium
flumotion.manager.manager.Vishnu vishnu: the vishnu that manages this avatar's heaven

Class Variable Summary
str logCategory: Implementors can provide a category to log their messages under.
NoneType portset = None                                                                  
    Inherited from ManagerAvatar
Implements __implemented__ = <implementedBy flumotion.manager.base....
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Avatar
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

createComponent(self, avatarId, type, config)

Create a component of the given type with the given config.
Parameters:
avatarId - avatarId the component should use to log in
           (type=str)
type - type of the component to create
           (type=str)
config - a configuration dictionary for the component
           (type=dict)
Returns:
a deferred that will give the avatarId the component will use to log in to the manager

detached(self, mind)

Tell the avatar that the peer's client referenced by the mind has detached.

Called through the manager's PB logout trigger calling flumotion.manager.manager.Dispatcher.removeAvatar
Parameters:
mind
           (type=twisted.spread.pb.RemoteReference)
Overrides:
flumotion.manager.base.ManagerAvatar.detached (inherited documentation)

perspective_componentAddMessage(self, avatarId, message)

Called by the worker to tell the manager to add a given message to the given component.

Useful in cases where the component can't report messages itself, for example because it crashed.
Parameters:
avatarId - avatarId of the component the message is about
message
           (type=flumotion.common.messages.Message)

releasePorts(self, ports)

Release the given list of ports on the worker.
Parameters:
ports - list of ports to release
           (type=list of int)

reservePorts(self, numPorts)

Reserve the given number of ports on the worker.
Parameters:
numPorts - how many ports to reserve
           (type=int)

Class Variable Details

logCategory

Implementors can provide a category to log their messages under.
Type:
str
Value:
'worker-avatar'                                                        

portset

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Sun Oct 22 03:16:48 2006 http://epydoc.sf.net