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

Class ManagerAvatar

source code

twisted.spread.pb.Avatar --+        
                           |        
 extern.log.log.Loggable --+        
                           |        
           twisted.pb.Avatar --+    
                               |    
       twisted.pb.PingableAvatar --+
                                   |
         extern.log.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, mind) source code
 
perspective_writeFluDebugMarker(self, level, marker)
Sets a marker that will be prefixed to the log strings.
source code
 
onShutdown(self) source code
 
mindCallRemote(self, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
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
 
perspective_keepAlive(self, bouncerName, issuerName, ttl)
Resets the expiry timeout for keycards issued by issuerName.
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: disconnect, mindCallRemoteLogging, perspectiveMessageReceived, perspectiveMessageReceivedUnserialised

Inherited from twisted.spread.pb.Avatar: __providedBy__

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

Class Methods [hide private]
 
makeAvatarInitArgs(klass, heaven, avatarId, remoteIdentity, mind) source code
 
makeAvatar(klass, heaven, avatarId, remoteIdentity, mind) source code
Class Variables [hide private]
str remoteLogName = 'medium'
name to use to log the other side of the connection
  logCategory = 'manager-avatar'
Implementors can provide a category to log their messages under.

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

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, mind)
(Constructor)

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

perspective_writeFluDebugMarker(self, level, marker)

source code 

Sets a marker that will be prefixed to the log strings. Setting this marker to multiple elements at a time helps debugging.

Parameters:
  • marker - A string to prefix all the log strings.
  • level - The log level. It can be log.ERROR, log.DEBUG, log.WARN, log.INFO or log.LOG

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

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_keepAlive(self, bouncerName, issuerName, ttl)

source code 

Resets the expiry timeout for keycards issued by issuerName. See flumotion.component.bouncers.bouncer for more information.

Parameters:
  • bouncerName (str or None) - the name of the atmosphere bouncer, or None
  • issuerName (str) - the issuer for which keycards should be kept alive; that is to say, keycards with the attribute 'issuerName' set to this value will have their ttl values reset.
  • ttl (number) - the new expiry timeout
Returns:
a deferred which will fire success or failure.

Since: 0.4.3

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