Package flumotion :: Package manager :: Module component :: Class ComponentAvatar
[hide private]

Class ComponentAvatar

source code

twisted.spread.pb.Avatar --+            
                           |            
     common.log.Loggable --+            
                           |            
           twisted.pb.Avatar --+        
                               |        
       twisted.pb.PingableAvatar --+    
                                   |    
             common.log.Loggable --+    
                                   |    
                  base.ManagerAvatar --+
                                       |
                                      ComponentAvatar

I am a Manager-side avatar for a component. I live in the ComponentHeaven.

Each component that logs in to the manager gets an avatar created for it in the manager.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
__repr__(self) source code
 
cleanup(self)
Clean up when detaching.
source code
 
_setMood(self, mood) source code
 
_setMoodValue(self, moodValue) source code
 
_getMoodValue(self) source code
 
_addMessage(self, message) source code
 
_mindErrback(self, failure, *ignores) source code
 
_mindPropertyErrback(self, failure) 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
 
stateSet(self, state, key, value) source code
 
parseEaterConfig(self, eater_config) source code
 
parseFeederConfig(self, feeder_config) source code
list of str
getEaters(self)
Get a list of feedIds for feeds this component wants to eat from.
source code
list of str
getFeeders(self)
Get a list of feedIds that this component has feeders for.
source code
int
getFeedServerPort(self)
Returns the port on which a feed server for this component is listening on.
source code
str
getRemoteManagerIP(self)
Get the IP address of the manager as seen by the component.
source code
str
getWorkerName(self)
Return the name of the worker.
source code
int
getPid(self)
Return the PID of the component.
source code
str
getName(self)
Get the name of the component.
source code
str
getParentName(self)
Get the name of the component's parent.
source code
str
getType(self)
Get the component type name of the component.
source code
 
stop(self)
Tell the avatar to stop the component.
source code
 
setup(self, conf)
Set up the component with the given config.
source code
 
start(self, *args, **kwargs)
Tell the component to start, possibly linking to other components.
source code
 
eatFrom(self, fullFeedId, host, port) source code
 
feedTo(self, componentId, feedId, host, port) source code
 
setElementProperty(self, element, property, value)
Set a property on an element.
source code
 
getElementProperty(self, element, property)
Get a property of an element.
source code
twisted.internet.defer.Deferred
reloadComponent(self)
Tell the component to reload itself.
source code
 
authenticate(self, keycard)
Authenticate the given keycard.
source code
 
removeKeycardId(self, keycardId)
Remove a keycard managed by this bouncer because the requester has gone.
source code
 
expireKeycard(self, keycardId)
Expire a keycard issued to this component because the bouncer decided to.
source code
 
perspective_feedReady(self, feedName, isReady)
Called by the component to tell the manager that a given feed is ready or not.
source code
 
perspective_cleanShutdown(self)
Called by a component to tell the manager that it's shutting down cleanly (and thus should go to sleeping, rather than lost or sad)
source code
 
perspective_error(self, element, error) source code
 
perspective_removeKeycardId(self, bouncerName, keycardId)
Remove a keycard on the given bouncer on behalf of a component's medium.
source code
 
perspective_expireKeycard(self, requesterId, keycardId)
Expire a keycard (and thus the requester's connection) issued to the given requester.
source code
 
perspective_reservePortsOnWorker(self, workerName, numberOfPorts)
Request reservation a number of ports on a particular worker.
source code

Inherited from base.ManagerAvatar: disconnect, getClientAddress, hasRemoteReference, mindCallRemote, perspective_authenticate, perspective_getBundleSums, perspective_getBundleSumsByFile, perspective_getBundleZips, perspective_getKeycardClasses, timeoutDisconnect

Inherited from base.ManagerAvatar (private): _mindCallRemoteErrback

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]
  logCategory = 'comp-avatar'
Implementors can provide a category to log their messages under.
str avatarId
the id for this avatar, unique inside the heaven
flumotion.common.planet.ManagerComponentState componentState
component state of this avatar's component
flumotion.common.planet.ManagerJobState jobState
job state of this avatar's component

Inherited from base.ManagerAvatar: remoteLogName

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

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

Instance Variables [hide private]

Inherited from base.ManagerAvatar: heaven, mind, vishnu

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Parameters:
  • heaven - the heaven this avatar is part of
  • avatarId - id of the avatar to create
  • remoteIdentity - manager-assigned identity object for this avatar
Overrides: twisted.pb.Avatar.__init__

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.

Overrides: base.ManagerAvatar.attached
(inherited documentation)

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

Overrides: base.ManagerAvatar.detached
(inherited documentation)

getEaters(self)

source code 

Get a list of feedIds for feeds this component wants to eat from.

Returns: list of str
a list of feedId's, or the empty list

getFeeders(self)

source code 

Get a list of feedIds that this component has feeders for.

Obviously, the componentName part will be the same for all of them, since it's the name of this component, but we return the feedId to be similar to getEaters.

Returns: list of str
a list of feedId's, or the empty list

setup(self, conf)

source code 

Set up the component with the given config. Proxies to flumotion.component.component.BaseComponentMedium.remote_setup

Parameters:
  • conf (dict)

setElementProperty(self, element, property, value)

source code 

Set a property on an element.

Parameters:
  • element (str) - the element to set the property on
  • property (str) - the property to set
  • value (mixed) - the value to set the property to

getElementProperty(self, element, property)

source code 

Get a property of an element.

Parameters:
  • element (str) - the element to get the property of
  • property (str) - the property to get

authenticate(self, keycard)

source code 

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:

removeKeycardId(self, keycardId)

source code 

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

Parameters:
  • keycardId (str)

expireKeycard(self, keycardId)

source code 

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

Parameters:
  • keycardId (str)

perspective_feedReady(self, feedName, isReady)

source code 

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 (str) - name of the feeder, e.g. "default".
  • isReady (bool @deprecated Don't call this!) - True if the feed is now ready, False otherwise.

perspective_removeKeycardId(self, bouncerName, keycardId)

source code 

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:
  • keycardId (str) - id of keycard to remove
  • bouncerName (str)

perspective_expireKeycard(self, requesterId, keycardId)

source code 

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

perspective_reservePortsOnWorker(self, workerName, numberOfPorts)

source code 

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 (str) - name of the worker to reserve ports on
  • numberOfPorts (int) - the number of ports to reserve