Package flumotion :: Package manager :: Module admin :: Class AdminAvatar
[hide private]

Class AdminAvatar

source code

twisted.spread.pb.Avatar --+            
                           |            
 extern.log.log.Loggable --+            
                           |            
           twisted.pb.Avatar --+        
                               |        
       twisted.pb.PingableAvatar --+    
                                   |    
         extern.log.log.Loggable --+    
                                   |    
                  base.ManagerAvatar --+
                                       |
                                      AdminAvatar

I am an avatar created for an administrative client interface. A reference to me is given (for example, to gui.AdminInterface) when logging in and requesting an "admin" avatar. I live in the manager.

Instance Methods [hide private]
 
perspectiveMessageReceived(self, broker, message, args, kwargs)
This method is called when a network message is received.
source code
flumotion.common.planet.ManagerPlanetState
perspective_getPlanetState(self)
Get the planet state.
source code
flumotion.common.worker.ManagerWorkerHeavenState
perspective_getWorkerHeavenState(self)
Get the worker heaven state.
source code
 
perspective_componentStart(self, componentState)
Start the given component.
source code
 
perspective_componentStop(self, componentState)
Stop the given component.
source code
 
perspective_componentRestart(self, componentState)
Restart the given component.
source code
twisted.internet.defer.Deferred
perspective_componentCallRemote(self, componentState, methodName, *args, **kwargs)
Call a method on the given component on behalf of an admin client.
source code
 
perspective_componentsList(self)
List components in the planet.
source code
 
perspective_componentInvoke(self, avatarId, methodName, *args, **kwargs)
Call a remote method on the component.
source code
 
perspective_upstreamList(self, avatarId)
List a component and its upstream components along with types and worker hosts.
source code
 
perspective_workerCallRemote(self, workerName, methodName, *args, **kwargs)
Call a remote method on the worker.
source code
 
perspective_getEntryByType(self, componentType, entryType)
Get the entry point for a piece of bundled code in a component by type.
source code
 
perspective_getPlugEntry(self, plugType, entryType)
Get the entry point for a piece of bundled code in a plug by type.
source code
str
perspective_getConfiguration(self)
Get the configuration of the manager as an XML string.
source code
 
perspective_getScenarioByType(self, scenarioType, entryType)
Remote method that gets the scenario of a given type.
source code
List of IScenarioAssistantPlugin
perspective_getScenarios(self)
Get all the scenarios defined on the registry.
source code
 
_saveFlowFile(self, filename)
Opens a file that the flow should be written to.
source code
 
perspective_loadConfiguration(self, xml, saveAs=None)
Load the given XML configuration into the manager.
source code
 
perspective_loadComponent(self, componentType, componentId, componentLabel, properties, workerName, plugs=None, eaters=None, isClockMaster=None, virtualFeeds=None)
Load a component into the manager configuration.
source code
 
perspective_deleteFlow(self, flowName) source code
 
perspective_deleteComponent(self, componentState)
Delete a component from the manager.
source code
 
perspective_getVersions(self) source code
 
perspective_cleanComponents(self) source code
 
perspective_getWizardEntries(self, types=None, provides=None, accepts=None)
Fetches the wizard entries which matches the parameters sent in
source code
ComponentRegistryEntry
perspective_getComponentEntry(self, componentType)
Fetches a ComponentRegistryEntry given a componentType
source code
 
perspective_invokeOnComponents(self, componentType, methodName, *args, **kwargs) source code

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

Inherited from twisted.pb.PingableAvatar: mindCallRemoteLogging, perspectiveMessageReceivedUnserialised, perspective_ping, setMind, startPingChecking, stopPingChecking

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

Inherited from twisted.pb.Avatar: disconnect

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

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

Class Methods [hide private]

Inherited from base.ManagerAvatar: makeAvatar, makeAvatarInitArgs

Class Variables [hide private]
  logCategory = 'admin-avatar'
Implementors can provide a category to log their messages under.

Inherited from base.ManagerAvatar: remoteLogName

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

Inherited from twisted.spread.pb.Avatar: __implemented__

Instance Variables [hide private]

Inherited from base.ManagerAvatar: avatarId, heaven, mind, vishnu

Method Details [hide private]

perspectiveMessageReceived(self, broker, message, args, kwargs)

source code 

This method is called when a network message is received.

This will call:

   self.perspective_%(message)s(*broker.unserialize(args),
                                **broker.unserialize(kw))

to handle the method; subclasses of Avatar are expected to implement methods using this naming convention.

Overrides: twisted.spread.pb.Avatar.perspectiveMessageReceived
(inherited documentation)

perspective_componentStart(self, componentState)

source code 

Start the given component. The component should be sleeping before this.

Parameters:

perspective_componentStop(self, componentState)

source code 

Stop the given component. If the component was sad, we clear its sad state as well, since the stop was explicitly requested by the admin.

Parameters:

perspective_componentRestart(self, componentState)

source code 

Restart the given component.

Parameters:

perspective_componentCallRemote(self, componentState, methodName, *args, **kwargs)

source code 

Call a method on the given component on behalf of an admin client.

Parameters:
Returns: twisted.internet.defer.Deferred

perspective_componentsList(self)

source code 

List components in the planet. Returns a list of avatar ids.

perspective_componentInvoke(self, avatarId, methodName, *args, **kwargs)

source code 

Call a remote method on the component.

Parameters:
  • avatarId (str) - the component avatar id
  • methodName (str) - name of the method to call

perspective_upstreamList(self, avatarId)

source code 

List a component and its upstream components along with types and worker hosts.

Parameters:
  • avatarId (str) - the component avatar id

perspective_workerCallRemote(self, workerName, methodName, *args, **kwargs)

source code 

Call a remote method on the worker. This is used so that admin clients can call methods from the interface to the worker.

Parameters:

perspective_getEntryByType(self, componentType, entryType)

source code 

Get the entry point for a piece of bundled code in a component by type.

Parameters:
  • componentType (a string) - the component
  • entryType (a string Returns: a (filename, methodName) tuple, or raises:
     - NoBundleError if the entry location does not exist
    
    ) - location of the entry point

perspective_getPlugEntry(self, plugType, entryType)

source code 

Get the entry point for a piece of bundled code in a plug by type.

Parameters:
  • plugType (a string) - the plug
  • entryType (a string Returns: a (filename, methodName) tuple, or raises:
     - NoBundleError if the entry location does not exist
    
    ) - location of the entry point

perspective_getScenarioByType(self, scenarioType, entryType)

source code 

Remote method that gets the scenario of a given type.

Parameters:
  • scenarioType (a string Returns: a (filename, methodName) tuple, or raises:
     - NoBundleError if the entry location does not exist
    
    ) - the component

_saveFlowFile(self, filename)

source code 

Opens a file that the flow should be written to.

Note that the returned file object might be an existing file, opened in append mode; if the loadConfiguration operation succeeds, the file should first be truncated before writing.

perspective_loadConfiguration(self, xml, saveAs=None)

source code 

Load the given XML configuration into the manager. If the optional saveAs parameter is passed, the XML snippet will be saved to disk in the manager's flows directory.

Parameters:
  • xml (str) - the XML configuration snippet.
  • saveAs (str) - The name of a file to save the XML as.

perspective_loadComponent(self, componentType, componentId, componentLabel, properties, workerName, plugs=None, eaters=None, isClockMaster=None, virtualFeeds=None)

source code 

Load a component into the manager configuration. Returns a deferred that will be called with the component state.

Parameters:
  • componentType (str) - The registered type of the component to be added
  • componentId (str) - The identifier of the component to add, should be created by the function flumotion.common.common.componentId
  • componentLabel (str or None) - The human-readable label of the component. if None, no label will be set.
  • properties (list of (str, object)) - List of property name-value pairs. See flumotion.common.config.buildPropertyDict
  • workerName (str) - the name of the worker where the added component should run.
  • plugs ([(str, [(str, object)])]) - List of plugs, as type-propertyList pairs. See {flumotion.manager.config.buildPlugsSet}.
  • eaters ([(str, str)]) - List of (eater name, feed ID) pairs. See flumotion.manager.config.buildEatersDict
  • isClockMaster (bool) - True if the component to be added must be a clock master. Passing False here means that the manager will choose what component, if any, will be clock master for this flow.
  • virtualFeeds ([(str, str)]) - List of (virtual feed, feeder name) pairs. See flumotion.manager.config.buildVirtualFeeds

perspective_deleteComponent(self, componentState)

source code 

Delete a component from the manager.

A component can only be deleted when it is sleeping or sad. It is the caller's job to ensure this is the case; calling this function on a running component will raise a ComponentBusyError.

Returns:
a deferred that will fire when all listeners have been notified of the component removal

perspective_getWizardEntries(self, types=None, provides=None, accepts=None)

source code 

Fetches the wizard entries which matches the parameters sent in

Parameters:
  • types (list of strings) - list of component types to fetch, is usually something like ['video-producer'] or ['audio-encoder']
  • provides (list of strings) - formats provided, eg ['jpeg', 'speex']
  • accepts (list of strings) - formats accepted, eg ['theora']
Returns:
componentui.WizardEntryState

perspective_getComponentEntry(self, componentType)

source code 

Fetches a ComponentRegistryEntry given a componentType

Parameters:
  • componentType (string) - component type
Returns: ComponentRegistryEntry
the component