Package flumotion :: Package manager :: Module base :: Class ManagerAvatar
[hide private]

Class ManagerAvatar

source code

twisted.spread.pb.Avatar --+        
                           |        
     common.log.Loggable --+        
                           |        
           twisted.pb.Avatar --+    
                               |    
       twisted.pb.PingableAvatar --+
                                   |
             common.log.Loggable --+
                                   |
                                  ManagerAvatar
Known Subclasses:

I am a base class for manager-side avatars to subclass from.

Instance Methods [hide private]
 
__init__(self, heaven, avatarId, remoteIdentity) source code
 
disconnect(self)
Disconnect the remote PB client.
source code
 
timeoutDisconnect(self) source code
bool
hasRemoteReference(self)
Check if the avatar has a remote reference to the peer.
source code
 
mindCallRemote(self, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
source code
 
_mindCallRemoteErrback(self, f, name) source code
 
attached(self, mind)
Tell the avatar that the given mind has been attached.
source code
 
detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
source code
str or None
getClientAddress(self)
Get the IPv4 address of the machine the PB client is connecting from, as seen from the avatar.
source code
list of (str, str) tuples of (bundleName, md5sum)
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.
source code
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.
source code
dict of str -> str
perspective_getBundleZips(self, bundles)
Get the zip files for the given list of bundles.
source code
 
perspective_authenticate(self, bouncerName, keycard)
Authenticate the given keycard.
source code
twisted.internet.defer.Deferred firing list of str
perspective_getKeycardClasses(self)
Get the keycard classes the manager's bouncer can authenticate.
source code

Inherited from twisted.pb.PingableAvatar: perspective_ping, setMind, startPingChecking, stopPingChecking

Inherited from twisted.pb.PingableAvatar (private): _pingCheck

Inherited from twisted.pb.Avatar: mindCallRemoteLogging, perspectiveMessageReceived

Inherited from twisted.spread.pb.Avatar: __providedBy__

Inherited from common.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
str remoteLogName = 'medium'
name to use to log the other side of the connection

Inherited from twisted.pb.PingableAvatar (private): _pingCheckInterval

Inherited from twisted.pb.Avatar: logCategory

Inherited from twisted.spread.pb.Avatar: __implemented__, __provides__

Instance Variables [hide private]
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
Method Details [hide private]

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

source code 
Parameters:
Overrides: twisted.pb.Avatar.__init__

disconnect(self)

source code 

Disconnect the remote PB client. If we are already disconnected, do nothing.

Overrides: twisted.pb.Avatar.disconnect
(inherited documentation)

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

source code 

Call the given remote method, and log calling and returning nicely.

Parameters:
  • name (str) - name of the remote method
Overrides: twisted.pb.Avatar.mindCallRemote

attached(self, mind)

source code 

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 (twisted.spread.pb.RemoteReference)

detached(self, mind)

source code 

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 (twisted.spread.pb.RemoteReference)

getClientAddress(self)

source code 

Get the IPv4 address of the machine the PB client is connecting from, as seen from the avatar.

Returns: str or None
the IPv4 address the client is coming from, or None.

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

source code 

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 (str or list of str) - the name of the bundle for fetching
  • fileName (str or list of str) - the name of the file requested for fetching
  • moduleName (str or list of str) - the name of the module requested for import
Returns: list of (str, str) tuples of (bundleName, md5sum)

perspective_getBundleSumsByFile(self, filename)

source code 

Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.

Parameters:
  • filename (str) - the name of the file in a bundle
Returns: list of (str, str) tuples
list of (bundleName, md5sum) tuples

perspective_getBundleZips(self, bundles)

source code 

Get the zip files for the given list of bundles.

Parameters:
  • bundles (list of str) - the names of the bundles to get
Returns: dict of str -> str
dictionary of bundleName -> zipdata

perspective_authenticate(self, bouncerName, keycard)

source code 

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:
Returns:
a deferred, returning the keycard or None.

Since: 0.3.1

perspective_getKeycardClasses(self)

source code 

Get the keycard classes the manager's bouncer can authenticate.

Returns: twisted.internet.defer.Deferred firing list of str
a deferred, returning a list of keycard class names

Since: 0.3.1