Package flumotion :: Package manager :: Module manager :: Class Vishnu
[hide private]

Class Vishnu

source code

extern.log.log.Loggable --+
                          |
                         Vishnu

I am the toplevel manager object that knows about all heavens and factories.

Instance Methods [hide private]
 
__init__(self, name, unsafeTracebacks=0, configDir=None) source code
 
shutdown(self)
Cancel any pending operations in preparation for shutdown.
source code
 
setConnectionInfo(self, host, port, use_ssl) source code
 
getConfiguration(self)
Returns the manager's configuration as a string suitable for importing via loadConfiguration().
source code
flumotion.common.bundle.BundlerBasket
getBundlerBasket(self)
Return a bundler basket to unbundle from.
source code
 
addMessage(self, level, id, format, *args, **kwargs)
Convenience message to construct a message and add it to the planet state.
source code
 
addMessageObject(self, message)
Add a message to the planet state.
source code
 
clearMessage(self, mid)
Clear any messages with the given message ID from the planet state.
source code
 
adminAction(self, identity, message, args, kw) source code
a deferred that will fire a flumotion.common.identity.RemoteIdentity
computeIdentity(self, keycard, remoteHost)
Compute a suitable identity for a remote host.
source code
flumotion.common.planet.ManagerComponentState
_addComponent(self, conf, parent, identity)
Add a component state for the given component config entry.
source code
list of flumotion.common.planet.ManagerComponentState
_updateStateFromConf(self, _, conf, identity)
Add a new config object into the planet state.
source code
 
_startComponents(self, components, identity) source code
 
_loadComponentConfiguration(self, conf, identity) source code
 
loadComponentConfigurationXML(self, file, identity)
Load the configuration from the given XML, merging it on top of the currently running configuration.
source code
 
_loadManagerPlugs(self, conf) source code
 
startManagerPlugs(self) source code
 
_loadManagerBouncer(self, conf) source code
 
loadManagerConfigurationXML(self, file)
Load manager configuration from the given XML.
source code
 
loadComponent(self, identity, componentType, componentId, componentLabel, properties, workerName, plugs, eaters, isClockMaster, virtualFeeds)
Load a component into the manager configuration.
source code
 
_createHeaven(self, interface, klass)
Create a heaven of the given klass that will send avatars to clients implementing the given medium interface.
source code
 
setBouncer(self, bouncer) source code
 
getFactory(self) source code
 
componentCreate(self, componentState)
Create the given component.
source code
 
_componentStopNoAvatar(self, componentState, avatarId) source code
 
_componentStopWithAvatar(self, componentState, componentAvatar) source code
twisted.internet.defer.Deferred
componentStop(self, componentState)
Stop the given component.
source code
 
componentAddMessage(self, avatarId, message)
Set the given message on the given component's state.
source code
 
workerAttached(self, workerAvatar) source code
 
_workerCreateComponents(self, workerId, components)
Create the list of components on the given worker, sequentially, but in no specific order.
source code
 
_workerCreateComponentDelayed(self, result, workerAvatar, componentState, componentType, conf) source code
 
_createCallback(self, result, componentState) source code
 
_createErrback(self, failure, state) source code
 
workerDetached(self, workerAvatar) source code
 
addComponentToFlow(self, componentState, flowName) source code
 
registerComponent(self, componentAvatar) source code
 
unregisterComponent(self, componentAvatar) source code
 
getComponentStates(self) source code
 
deleteComponent(self, componentState)
Empty the planet of the given component.
source code
 
_getFlowByName(self, flowName) source code
 
deleteFlow(self, flowName)
Empty the planet of a flow.
source code
 
emptyPlanet(self)
Empty the planet of all components, and flows.
source code
 
_emptyPlanetCallback(self, result) source code
list of flumotion.common.planet.ManagerComponentState
_getComponentsToCreate(self) source code
 
_getWorker(self, workerName) source code
 
getWorkerFeedServerPort(self, workerName) source code
 
reservePortsOnWorker(self, workerName, numPorts)
Requests a number of ports on the worker named workerName.
source code
 
releasePortsOnWorker(self, workerName, ports)
Tells the manager that the given ports are no longer being used, and may be returned to the allocation pool.
source code
ComponentMapper or None
getComponentMapper(self, object)
Look up an object mapper given the object.
source code
ComponentMapper or None
getManagerComponentState(self, object)
Look up an object mapper given the object.
source code

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

Class Variables [hide private]
  logCategory = 'vishnu'
Implementors can provide a category to log their messages under.
  __pychecker__ = 'maxargs=11'
  __implemented__ = <implementedBy flumotion.manager.manager.Vis...
  __provides__ = <zope.interface.declarations.ClassProvides obje...
admin.AdminHeaven adminHeaven
the admin heaven
component.ComponentHeaven componentHeaven
the component heaven
str configDir
the configuration directory for this Vishnu's manager
Dispatcher dispatcher
dispatcher to create avatars
worker.WorkerHeaven workerHeaven
the worker heaven
Method Details [hide private]

shutdown(self)

source code 

Cancel any pending operations in preparation for shutdown.

This method is mostly useful for unit tests; currently, it is not called during normal operation. Note that the caller is responsible for stopping listening on the port, as the the manager does not have a handle on the twisted port object.

Returns:
A deferred that will fire when the manager has shut down.

getBundlerBasket(self)

source code 

Return a bundler basket to unbundle from. If the registry files were updated since the last time, the bundlerbasket will be rebuilt.

Returns: flumotion.common.bundle.BundlerBasket

Since: 0.2.2

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

source code 

Convenience message to construct a message and add it to the planet 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:

clearMessage(self, mid)

source code 

Clear any messages with the given message ID from the planet state.

Parameters:
  • mid (message ID, normally a str)

adminAction(self, identity, message, args, kw)

source code 
Parameters:

computeIdentity(self, keycard, remoteHost)

source code 

Compute a suitable identity for a remote host. First looks to see if there is a flumotion.component.plugs.identity.IdentityProvider plug installed on the manager, falling back to user@host.

The identity is only used in the adminaction interface. An example of its use is when you have an adminaction plug that checks an admin's privileges before actually doing an action; the identity object you use here might store the privileges that the admin has.

Parameters:
Returns: a deferred that will fire a flumotion.common.identity.RemoteIdentity

_updateStateFromConf(self, _, conf, identity)

source code 

Add a new config object into the planet state.

Returns: list of flumotion.common.planet.ManagerComponentState
a list of all components added

loadComponentConfigurationXML(self, file, identity)

source code 

Load the configuration from the given XML, merging it on top of the currently running configuration.

Parameters:
  • file (str or file) - file to parse, either as an open file object, or as the name of a file to open
  • identity (flumotion.common.identity.Identity) - The identity making this request.. This is used by the adminaction logging mechanism in order to say who is performing the action.

loadManagerConfigurationXML(self, file)

source code 

Load manager configuration from the given XML. The manager configuration is currently used to load the manager's bouncer and plugs, and is only run once at startup.

Parameters:
  • file (str or file) - file to parse, either as an open file object, or as the name of a file to open

loadComponent(self, identity, componentType, componentId, componentLabel, properties, workerName, plugs, eaters, isClockMaster, virtualFeeds)

source code 

Load a component into the manager configuration.

See flumotion.manager.admin.AdminAvatar.perspective_loadComponent for a definition of the argument types.

_createHeaven(self, interface, klass)

source code 

Create a heaven of the given klass that will send avatars to clients implementing the given medium interface.

Parameters:

setBouncer(self, bouncer)

source code 
Parameters:

componentCreate(self, componentState)

source code 

Create the given component. This will currently also trigger a start eventually when the component avatar attaches.

The component should be sleeping. The worker it should be started on should be present.

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:
Returns: twisted.internet.defer.Deferred

componentAddMessage(self, avatarId, message)

source code 

Set the given message on the given component's state. Can be called e.g. by a worker to report on a crashed component. Sets the mood to sad if it is an error message.

_workerCreateComponents(self, workerId, components)

source code 

Create the list of components on the given worker, sequentially, but in no specific order.

Parameters:

deleteComponent(self, componentState)

source code 

Empty the planet of the given component.

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

deleteFlow(self, flowName)

source code 

Empty the planet of a flow.

Returns:
a deferred that will fire when the flow is removed.

emptyPlanet(self)

source code 

Empty the planet of all components, and flows. Also clears all messages.

Returns:
a deferred that will fire when the planet is empty.

reservePortsOnWorker(self, workerName, numPorts)

source code 

Requests a number of ports on the worker named workerName. The ports will be reserved for the use of the caller until releasePortsOnWorker is called.

Returns:
a list of ports as integers

Class Variable Details [hide private]

__implemented__

Value:
<implementedBy flumotion.manager.manager.Vishnu>

__provides__

Value:
<zope.interface.declarations.ClassProvides object at 0xa596e8c>