Package flumotion :: Package manager :: Module component :: Class ComponentAvatar
[show private | hide private]
[frames | no frames]

Class ComponentAvatar

   Avatar --+    
            |    
 Loggable --+    
            |    
ManagerAvatar --+
                |
               ComponentAvatar


Manager-side avatar for a component. Each component that logs in to the manager gets an avatar created for it in the manager.
Method Summary
  __init__(self, heaven, avatarId)
  __del__(self)
  __repr__(self)
  attached(self, mind)
Tell the avatar that the given mind has been attached.
  authenticate(self, keycard)
  cleanup(self)
Clean up when detaching.
  detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
  expireKeycard(self, keycardId)
Expire a keycard issued to this component because the bouncer decided to.
  getEaters(self)
Get a list of feeder names feeding this component.
  getElementProperty(self, element, property)
Get a property of an element.
  getFeeders(self)
Get a list of feeder names (componentName:feedName) in this component.
  getFeedPort(self, feedName)
Returns the port this feed is being fed on.
  getName(self)
  getParentName(self)
  getPid(self)
  getRemoteManagerIP(self)
  getType(self)
  getWorkerName(self)
Return the name of the worker.
  perspective_adminCallRemote(self, methodName, *args, **kwargs)
  perspective_authenticate(self, bouncerName, keycard)
Authenticate the given keycard using the given bouncer.
  perspective_error(self, element, error)
  perspective_expireKeycard(self, requesterName, keycardId)
Expire a keycard (and thus the requester's connection) issued to the given requester.
  perspective_feedReady(self, feedName, port)
Called by the component to tell the manager that a given feed is ready or not.
  perspective_heartbeat(self, moodValue)
  perspective_removeKeycard(self, bouncerName, keycardId)
Remove a keycard on the given bouncer on behalf of a component's medium.
twisted.internet.defer.Deferred reloadComponent(self)
Tell the component to reload itself.
  removeKeycard(self, keycardId)
Remove a keycard managed by this bouncer because the requester has gone.
  setElementProperty(self, element, property, value)
Set a property on an element.
  start(self, *args, **kwargs)
  stateAppend(self, state, key, value)
  stateRemove(self, state, key, value)
  stateSet(self, state, key, value)
  stop(self)
Tell the avatar to stop the component.
    Inherited from ManagerAvatar
  getClientAddress(self)
Get the IPv4 address of the machine the client is connecting from.
boolean 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 (string, string) 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 (string, string) tuples perspective_getBundleSumsByFile(self, filename)
Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
  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.

Class Variable Summary
MetaInterface __implements__ = flumotion.twisted.flavors.IStateListener
str logCategory: Implementors can provide a category to log their messages under.

Method Details

__init__(self, heaven, avatarId)
(Constructor)

Parameters:
heaven
           (type=flumotion.manager.base.ManagerHeaven)
Overrides:
flumotion.manager.base.ManagerAvatar.__init__ (inherited documentation)

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)
Overrides:
flumotion.manager.base.ManagerAvatar.attached (inherited documentation)

cleanup(self)

Clean up when detaching.

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
Overrides:
flumotion.manager.base.ManagerAvatar.detached (inherited documentation)

expireKeycard(self, keycardId)

Expire a keycard issued to this component because the bouncer decided to.

getEaters(self)

Get a list of feeder names feeding this component.

Returns: a list of eater names, or the empty list.

getElementProperty(self, element, property)

Get a property of an element.
Parameters:
element - the element to get the property of
           (type=string)
property - the property to get
           (type=string)

getFeeders(self)

Get a list of feeder names (componentName:feedName) in this component.

Returns: a list of feeder names, or the empty list.

getFeedPort(self, feedName)

Returns the port this feed is being fed on.

getWorkerName(self)

Return the name of the worker.

perspective_authenticate(self, bouncerName, keycard)

Authenticate the given keycard using the given bouncer. The bouncer needs to be part of the atmosphere.
Parameters:
bouncerName
           (type=string)
keycard - keycard to authenticate

perspective_expireKeycard(self, requesterName, keycardId)

Expire a keycard (and thus the requester's connection) issued to the given requester.

This is called by the bouncer component that authenticated the keycard.

perspective_feedReady(self, feedName, port)

Called by the component to tell the manager that a given feed is ready or not. Will notify other components depending on this feeder, starting them if all of their dependencies are ready.
Parameters:
feedName - name of the feeder, e.g. "default".
           (type=string)
port - port on which the feed is, or None if the port is being deactivated.
           (type=int or NoneType)

perspective_removeKeycard(self, bouncerName, keycardId)

Remove a keycard on the given bouncer on behalf of a component's medium.

This is requested by a component that created the keycard.
Parameters:
bouncerName
           (type=string)
keycardId - id of keycard to remove

reloadComponent(self)

Tell the component to reload itself.
Returns:
twisted.internet.defer.Deferred

removeKeycard(self, keycardId)

Remove a keycard managed by this bouncer because the requester has gone.

setElementProperty(self, element, property, value)

Set a property on an element.
Parameters:
element - the element to set the property on
           (type=string)
property - the property to set
           (type=string)
value - the value to set the property to
           (type=mixed)

stop(self)

Tell the avatar to stop the component.

Class Variable Details

logCategory

Implementors can provide a category to log their messages under.
Type:
str
Value:
'comp-avatar'                                                          

Generated by Epydoc 2.1 on Tue Dec 20 15:33:10 2005 http://epydoc.sf.net