Package flumotion :: Package manager :: Module base :: Class ManagerAvatar
[show private | hide private]
[frames | no frames]

Class ManagerAvatar

  Avatar --+
           |
Loggable --+
           |
          ManagerAvatar

Known Subclasses:
AdminAvatar, ComponentAvatar, WorkerAvatar

I am a base class for manager-side avatars to subclass from.
Method Summary
  __init__(self, heaven, avatarId)
  attached(self, mind)
Tell the avatar that the given mind has been attached.
  detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
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
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
Implements __implemented__ = <implementedBy flumotion.manager.base....
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Avatar
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
    Inherited from Loggable
str logCategory: Implementors can provide a category to log their messages under.

Method Details

__init__(self, heaven, avatarId)
(Constructor)

Parameters:
heaven - the heaven this avatar is part of
           (type=flumotion.manager.base.ManagerHeaven)
avatarId - id of the avatar to create
           (type=str)

attached(self, mind)

Tell the avatar that the given mind has been attached. This gives the avatar a way to call remotely to the client that requested this avatar. This is scheduled by the portal after the client has logged in.
Parameters:
mind
           (type=twisted.spread.pb.RemoteReference)

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)

getClientAddress(self)

Get the IPv4 address of the machine the PB client is connecting from, as seen from the avatar.
Returns:
the IPv4 address the client is coming from, or None.
           (type=str or None)

hasRemoteReference(self)

Check if the avatar has a remote reference to the peer.
Returns:
bool

mindCallRemote(self, name, *args, **kwargs)

Call the given remote method.
Parameters:
name - name of the remote method
           (type=str)

perspective_getBundleSums(self, bundleName=None, fileName=None, moduleName=None)

Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order. One of bundleName, fileName, moduleName must be given.
Parameters:
bundleName - the name of the bundle for fetching
           (type=str)
fileName - the name of the file requested for fetching
           (type=str)
moduleName - the name of the module requested for import
           (type=str)
Returns:
list of (bundleName, md5sum) tuples
           (type=list of tuple of (str, str))

perspective_getBundleSumsByFile(self, filename)

Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
Parameters:
filename - the name of the file in a bundle
           (type=str)
Returns:
list of (bundleName, md5sum) tuples
           (type=list of (str, str) tuples)

perspective_getBundleZips(self, bundles)

Get the zip files for the given list of bundles.
Parameters:
bundles - the names of the bundles to get
           (type=list of str)
Returns:
dictionary of bundleName -> zipdata
           (type=dict of str -> str)

Instance Variable Details

avatarId

the id for this avatar, unique inside the heaven
Type:
str

heaven

the heaven this avatar is part of
Type:
flumotion.manager.base.ManagerHeaven

mind

a remote reference to the client-side Medium
Type:
twisted.spread.pb.RemoteReference

vishnu

the vishnu that manages this avatar's heaven
Type:
flumotion.manager.manager.Vishnu

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy flumotion.manager.base.ManagerAvatar>                   

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x72073230>       

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