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

Class ManagerAvatar

        Loggable --+
                   |
  Avatar --+       |
           |       |
Loggable --+       |
           |       |
      Avatar --+   |
               |   |
  PingableAvatar --+
                   |
                  ManagerAvatar

Known Subclasses:
AdminAvatar, ComponentAvatar, WorkerAvatar

I am a base class for manager-side avatars to subclass from.
Method Summary
  __init__(self, heaven, avatarId, remoteIdentity)
  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.
  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
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 remoteLogName: name to use to log the other side of the connection
    Inherited from PingableAvatar
float _pingCheckInterval = 12.5                                                                  
    Inherited from Avatar
str logCategory: Implementors can provide a category to log their messages under.
    Inherited from Avatar
Implements __implemented__ = <implementedBy twisted.spread.pb.Avata...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

__init__(self, heaven, avatarId, remoteIdentity)
(Constructor)

Parameters:
heaven - the heaven this avatar is part of
           (type=flumotion.manager.base.ManagerHeaven)
avatarId - id of the avatar to create
           (type=str)
remoteIdentity - manager-assigned identity object for this avatar
           (type=flumotion.common.identity.RemoteIdentity)
Overrides:
flumotion.twisted.pb.Avatar.__init__

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)

disconnect(self)

Disconnect the remote PB client. If we are already disconnected, do nothing.
Overrides:
flumotion.twisted.pb.Avatar.disconnect (inherited documentation)

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, and log calling and returning nicely.
Parameters:
name - name of the remote method
           (type=str)
Overrides:
flumotion.twisted.pb.Avatar.mindCallRemote

perspective_authenticate(self, bouncerName, keycard)

Authenticate the given keycard. If no bouncerName given, authenticate against the manager's bouncer. If a bouncerName is given, authenticate against the given bouncer in the atmosphere.
Parameters:
bouncerName - the name of the atmosphere bouncer, or None
           (type=str or None)
keycard - the keycard to authenticate
           (type=flumotion.common.keycards.Keycard)
Returns:
a deferred, returning the keycard or None.

Since: 0.3.1

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. Any of bundleName, fileName, moduleName may be given.
Parameters:
bundleName - the name of the bundle for fetching
           (type=str or list of str)
fileName - the name of the file requested for fetching
           (type=str or list of str)
moduleName - the name of the module requested for import
           (type=str or list of str)
Returns:
list of (str, str) tuples of (bundleName, md5sum)

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)

perspective_getKeycardClasses(self)

Get the keycard classes the manager's bouncer can authenticate.
Returns:
a deferred, returning a list of keycard class names
           (type=twisted.internet.defer.Deferred firing list of str)

Since: 0.3.1


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

remoteLogName

name to use to log the other side of the connection
Type:
str
Value:
'medium'                                                               

Generated by Epydoc 2.1 on Sat Apr 14 13:20:44 2007 http://epydoc.sf.net