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

Class WorkerAvatar

        Loggable --+    
                   |    
  Avatar --+       |    
           |       |    
Loggable --+       |    
           |       |    
      Avatar --+   |    
               |   |    
  PingableAvatar --+    
                   |    
       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, nice)
Create a component of the given type with the given nice level.
  detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
  getComponents(self)
Get a list of components that the worker is running.
  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, remoteIdentity)
  disconnect(self)
Disconnect the remote PB client.
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, and log calling and returning nicely.
  perspective_authenticate(self, bouncerName, keycard)
Authenticate the given keycard.
list of (str, str) tuples of (bundleName, md5sum) 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.
twisted.internet.defer.Deferred firing list of str perspective_getKeycardClasses(self)
Get the keycard classes the manager's bouncer can authenticate.
  timeoutDisconnect(self)
  _mindCallRemoteErrback(self, f, name)
    Inherited from PingableAvatar
  perspective_ping(self)
  setMind(self, mind)
Tell the avatar that the given mind has been attached.
  startPingChecking(self, disconnect)
  stopPingChecking(self)
  _pingCheck(self)
    Inherited from Avatar
  mindCallRemoteLogging(self, level, stackDepth, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
  perspectiveMessageReceived(self, broker, message, args, kwargs)
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
dict doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, *args)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure, swallow)
Log a warning about a Failure.

Instance Variable Summary
int feedServerPort: TCP port the feed server is listening on
    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
str remoteLogName: name to use to log the other side of the connection
    Inherited from PingableAvatar
float _pingCheckInterval = 12.5                                                                  
    Inherited from Avatar
Implements __implemented__ = <implementedBy twisted.spread.pb.Avata...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

createComponent(self, avatarId, type, nice)

Create a component of the given type with the given nice level.
Parameters:
avatarId - avatarId the component should use to log in
           (type=str)
type - type of the component to create
           (type=str)
nice - the nice level to create the component at
           (type=int)
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)

getComponents(self)

Get a list of components that the worker is running.
Returns:
a deferred that will give the avatarIds running on the worker

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)

Instance Variable Details

feedServerPort

TCP port the feed server is listening on
Type:
int
Value:
None                                                                  

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 Sat Apr 14 13:11:55 2007 http://epydoc.sf.net