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

Class ComponentAvatar

source code

twisted.spread.pb.Avatar --+            
                           |            
 extern.log.log.Loggable --+            
                           |            
           twisted.pb.Avatar --+        
                               |        
       twisted.pb.PingableAvatar --+    
                                   |    
         extern.log.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, heaven, avatarId, remoteIdentity, mind, conf, jobState, clocking) source code
 
__repr__(self) source code
 
onShutdown(self) source code
 
addMessage(self, level, id, format, *args, **kwargs)
Convenience message to construct a message and add it to the component state.
source code
 
addMessageObject(self, message)
Add a message to the planet state.
source code
 
upgradeConfig(self, state, conf) source code
 
makeComponentState(self, conf) source code
twisted.internet.defer.Deferred
provideMasterClock(self)
Tell the component to provide a master clock.
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
dict of eaterName -> [(feedId, eaterAlias)]
getEaters(self)
Get the set of eaters that this component eats from.
source code
list of feederName
getFeeders(self)
Get the list of feeders that this component provides.
source code
flumotion.common.common.feedId
getFeedId(self, feedName)
Get the feedId of a feed provided or consumed by this component.
source code
flumotion.common.common.fullFeedId
getFullFeedId(self, feedName)
Get the full feedId of a feed provided or consumed by this component.
source code
dict of fullFeedId -> (ComponentAvatar, feederName)
getVirtualFeeds(self)
Get the set of virtual feeds provided by this component.
source code
str
getWorker(self)
Get the worker that this component should run on.
source code
avatarId or None
getClockMaster(self)
Get this component's clock master, if any.
source code
 
stop(self)
Tell the remote component to shut down.
source code
 
setClocking(self, host, port, base_time) source code
 
eatFrom(self, eaterAlias, fullFeedId, host, port) source code
 
feedTo(self, feederName, fullFeedId, host, port) 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_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_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

Inherited from base.ManagerAvatar: getClientAddress, mindCallRemote, perspective_authenticate, perspective_getBundleSums, perspective_getBundleSumsByFile, perspective_getBundleZips, perspective_getKeycardClasses, perspective_keepAlive, perspective_writeFluDebugMarker

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

Inherited from base.ManagerAvatar: makeAvatar

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, heaven, avatarId, remoteIdentity, mind, conf, jobState, clocking)
(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
  • mind - a remote reference to the client-side Medium
Overrides: twisted.pb.Avatar.__init__

makeAvatarInitArgs(klass, heaven, avatarId, remoteIdentity, mind)
Class Method

source code 
Overrides: base.ManagerAvatar.makeAvatarInitArgs

onShutdown(self)

source code 
Overrides: base.ManagerAvatar.onShutdown

addMessage(self, level, id, format, *args, **kwargs)

source code 

Convenience message to construct a message and add it to the component state. `format' should be marked as translatable in the source with N_, and *args will be stored as format arguments. Keyword arguments are passed on to the message constructor. See flumotion.common.messages.Message for the meanings of the rest of the arguments.

For example:

 self.addMessage(messages.WARNING, 'foo-warning',
                 N_('The answer is %d'), 42, debug='not really')

addMessageObject(self, message)

source code 

Add a message to the planet state.

Parameters:

getFeedId(self, feedName)

source code 

Get the feedId of a feed provided or consumed by this component.

Parameters:
  • feedName - The name of the feed (i.e., eater alias or feeder name)
Returns: flumotion.common.common.feedId

getFullFeedId(self, feedName)

source code 

Get the full feedId of a feed provided or consumed by this component.

Parameters:
  • feedName - The name of the feed (i.e., eater alias or feeder name)
Returns: flumotion.common.common.fullFeedId

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_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