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)
Authenticate the given 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.
list of str getEaters(self)
Get a list of feeder names feeding this component.
  getElementProperty(self, element, property)
Get a property of an element.
list of str getFeeders(self)
Get a list of feeder names (componentName:feedName) in this component.
int getFeedPort(self, feedName)
Returns the port this feed is being fed on.
str getName(self)
Get the name of the component.
str getParentName(self)
Get the name of the component's parent.
int getPid(self)
Return the PID of the component.
str getRemoteManagerIP(self)
Get the IP address of the manager as seen by the component.
str getType(self)
Get the component type name of the component.
str getWorkerName(self)
Return the name of the worker.
  perspective_adminCallRemote(self, methodName, *args, **kwargs)
Call the given method on all connected admin clients.
  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, isReady)
Called by the component to tell the manager that a given feed is ready or not.
  perspective_heartbeat(self, moodValue)
Called by the component to tell the manager that this component is still alive and kicking.
  perspective_removeKeycardId(self, bouncerName, keycardId)
Remove a keycard on the given bouncer on behalf of a component's medium.
  perspective_reservePortsOnWorker(self, workerName, numberOfPorts)
Request reservation a number of ports on a particular worker.
twisted.internet.defer.Deferred reloadComponent(self)
Tell the component to reload itself.
  removeKeycardId(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.
  setup(self, config)
Set up the component with the given config.
  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
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
    Inherited from ManagerAvatar
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
tuple __implements__ = (<class 'flumotion.twisted.flavors.ISta...
flumotion.common.planet.ManagerComponentState componentState: component state of this avatar's component
flumotion.common.planet.ManagerJobState jobState: job state of this avatar's component
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)
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)

authenticate(self, keycard)

Authenticate the given keycard. Gets proxied to flumotion.component.bouncers.bouncer.BouncerMedium.remote_authenticate The component should be a subclass of flumotion.component.bouncers.bouncer.Bouncer
Parameters:
keycard
           (type=flumotion.common.keycards.Keycard)

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
Parameters:
mind
           (type=twisted.spread.pb.RemoteReference)
Overrides:
flumotion.manager.base.ManagerAvatar.detached (inherited documentation)

expireKeycard(self, keycardId)

Expire a keycard issued to this component because the bouncer decided to.
Parameters:
keycardId
           (type=str)

getEaters(self)

Get a list of feeder names feeding this component.
Returns:
a list of eater names, or the empty list
           (type=list of str)

getElementProperty(self, element, property)

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

getFeeders(self)

Get a list of feeder names (componentName:feedName) in this component.
Returns:
a list of feeder names, or the empty list
           (type=list of str)

getFeedPort(self, feedName)

Returns the port this feed is being fed on.
Returns:
int

getName(self)

Get the name of the component.
Returns:
str

getParentName(self)

Get the name of the component's parent.
Returns:
str

getPid(self)

Return the PID of the component.
Returns:
int

getRemoteManagerIP(self)

Get the IP address of the manager as seen by the component.
Returns:
str

getType(self)

Get the component type name of the component.
Returns:
str

getWorkerName(self)

Return the name of the worker.
Returns:
str

perspective_adminCallRemote(self, methodName, *args, **kwargs)

Call the given method on all connected admin clients.
Parameters:
methodName
           (type=str)

See Also: flumotion.manager.admin.AdminHeaven.avatarsCallRemote

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=str)
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.
Parameters:
requesterName - name (avatarId) of the component that originally requested authentication for the given keycardId
           (type=str)
keycardId - id of keycard to expire
           (type=str)

perspective_feedReady(self, feedName, isReady)

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=str)
isReady - True if the feed is now ready, False otherwise.
           (type=bool)

perspective_heartbeat(self, moodValue)

Called by the component to tell the manager that this component is still alive and kicking.
Parameters:
moodValue
           (type=int)

perspective_removeKeycardId(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=str)
keycardId - id of keycard to remove
           (type=str)

perspective_reservePortsOnWorker(self, workerName, numberOfPorts)

Request reservation a number of ports on a particular worker. This can be called from a job if it needs some ports itself.
Parameters:
workerName - name of the worker to reserve ports on
           (type=str)
numberOfPorts - the number of ports to reserve
           (type=int)

reloadComponent(self)

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

removeKeycardId(self, keycardId)

Remove a keycard managed by this bouncer because the requester has gone.
Parameters:
keycardId
           (type=str)

setElementProperty(self, element, property, value)

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

setup(self, config)

Set up the component with the given config. Proxies to flumotion.component.component.BaseComponentMedium.remote_setup
Parameters:
config
           (type=dict)

stop(self)

Tell the avatar to stop the component.

Class Variable Details

__implements__

Type:
tuple
Value:
(<class 'flumotion.twisted.flavors.IStateListener'>,)                  

componentState

component state of this avatar's component
Type:
flumotion.common.planet.ManagerComponentState

jobState

job state of this avatar's component
Type:
flumotion.common.planet.ManagerJobState

logCategory

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

Generated by Epydoc 2.1 on Thu Jan 25 09:31:09 2007 http://epydoc.sf.net