Package flumotion :: Package manager :: Module manager :: Class Vishnu
[show private | hide private]
[frames | no frames]

Class Vishnu

Loggable --+
           |
          Vishnu


I am the toplevel manager object that knows about all heavens and factories.
Method Summary
  __init__(self, name, unsafeTracebacks, configDir)
  adminAction(self, identity, message, args, kw)
  componentAddMessage(self, avatarId, message)
Set the given message on the given component's state.
  componentAttached(self, componentAvatar)
  componentCreate(self, componentState)
Create the given component.
  componentDetached(self, componentAvatar)
defer.Deferred componentStop(self, componentState)
Stop the given component.
a deferred that will fire a flumotion.common.identity.RemoteIdentity computeIdentity(self, keycard, remoteHost)
Compute a suitable identity for a remote host.
  deleteComponent(self, componentState)
Empty the planet of the given component.
  deleteFlow(self, *args, **kwargs)
  emptyPlanet(self)
Empty the planet of all components, and flows.
flumotion.common.bundle.BundlerBasket getBundlerBasket(self)
Return a bundler basket to unbundle from.
ComponentMapper or None getComponentMapper(self, object)
Look up an object mapper given the object.
  getComponentStates(self)
  getConfiguration(self)
Returns the manager's configuration as a string suitable for importing via loadConfiguration().
  getFactory(self)
  getWorkerFeedServerPort(self, workerName)
  loadConfigurationXML(self, file, identity)
Load the configuration from the given XML, merging it on top of the currently running configuration.
  registerComponent(self, componentAvatar)
  releasePortsOnWorker(self, workerName, ports)
Tells the manager that the given ports are no longer being used, and may be returned to the allocation pool.
  reservePortsOnWorker(self, workerName, numPorts)
Requests a number of ports on the worker named workerName.
  setBouncer(self, bouncer)
  setConnectionInfo(self, host, port, use_ssl)
  unregisterComponent(self, componentAvatar)
  workerAttached(self, workerAvatar)
  workerDetached(self, workerAvatar)
flumotion.common.planet.ManagerComponentState _addComponent(self, conf, parent, identity)
Add a component state for the given component config entry.
  _addManagerPlug(self, socket, args, identity)
  _addManagerPlugs(self, _, conf, identity)
  _createCallback(self, result, componentState)
  _createErrback(self, failure, state)
  _createHeaven(self, interface, klass)
Create a heaven of the given klass that will send avatars to clients implementing the given medium interface.
  _emptyPlanetCallback(self, result)
  _getComponentState(self, deferredListResult, avatar)
list of flumotion.common.planet.ManagerComponentState _getComponentsToCreate(self)
  _getWorker(self, workerName)
  _loadConfiguration(self, conf, identity)
  _makeBouncer(self, conf, identity)
  _startComponents(self, components, conf, identity)
  _updateFlowDependencies(self, state)
list of flumotion.common.planet.ManagerComponentState _updateStateFromConf(self, _, conf, identity)
Add a new config object into the planet state.
  _workerCreateComponentDelayed(self, result, workerAvatar, componentState, type, conf)
  _workerCreateComponents(self, workerId, components)
Create the list of components on the given worker, sequentially, but in no specific order.
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
dict doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, *args)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure, swallow)
Log a warning about a Failure.

Class Variable Summary
Implements __implemented__ = <implementedBy flumotion.manager.manag...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
admin.AdminHeaven adminHeaven: the admin heaven
component.ComponentHeaven componentHeaven: the component heaven
Dispatcher dispatcher: dispatcher to create avatars
str logCategory: Implementors can provide a category to log their messages under.
worker.WorkerHeaven workerHeaven: the worker heaven
    Inherited from Loggable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

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

Parameters:
identity - flumotion.common.identity.Identity

componentAddMessage(self, avatarId, message)

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.

componentCreate(self, componentState)

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)

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:
componentState
           (type=planet.ManagerComponentState)
Returns:
defer.Deferred

computeIdentity(self, keycard, remoteHost)

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:
keycard - the keycard that the remote host used to log in.
           (type=flumotion.common.keycards.Keycard)
remoteHost - the ip of the remote host
           (type=str)
Returns:
a deferred that will fire a flumotion.common.identity.RemoteIdentity

deleteComponent(self, componentState)

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.

emptyPlanet(self)

Empty the planet of all components, and flows.
Returns:
a deferred that will fire when the planet is empty.

getBundlerBasket(self)

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

getComponentMapper(self, object)

Look up an object mapper given the object.
Returns:
ComponentMapper or None

getConfiguration(self)

Returns the manager's configuration as a string suitable for importing via loadConfiguration().

loadConfigurationXML(self, file, identity)

Load the configuration from the given XML, merging it on top of the currently running configuration.
Parameters:
file - file to parse, either as an open file object, or as the name of a file to open
           (type=str or file)
identity - The identity making this request.. This is used by the adminaction logging mechanism in order to say who is performing the action.
           (type=flumotion.common.identity.Identity)

releasePortsOnWorker(self, workerName, ports)

Tells the manager that the given ports are no longer being used, and may be returned to the allocation pool.

reservePortsOnWorker(self, workerName, numPorts)

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

setBouncer(self, bouncer)

Parameters:
bouncer
           (type=flumotion.component.bouncers.bouncer.Bouncer)

_addComponent(self, conf, parent, identity)

Add a component state for the given component config entry.
Returns:
flumotion.common.planet.ManagerComponentState

_createHeaven(self, interface, klass)

Create a heaven of the given klass that will send avatars to clients implementing the given medium interface.
Parameters:
interface - the medium interface to create a heaven for
           (type=flumotion.common.interfaces.IMedium)
klass - the type of heaven to create
           (type=an implementor of flumotion.common.interfaces.IHeaven)

_getComponentsToCreate(self)

Returns:
list of flumotion.common.planet.ManagerComponentState

_updateStateFromConf(self, _, conf, identity)

Add a new config object into the planet state.
Returns:
a list of all components added
           (type=list of flumotion.common.planet.ManagerComponentState)

_workerCreateComponents(self, workerId, components)

Create the list of components on the given worker, sequentially, but in no specific order.
Parameters:
workerId - avatarId of the worker
           (type=string)
components - components to start
           (type=list of flumotion.common.planet.ManagerComponentState)

Class Variable Details

__implemented__

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

__provides__

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

adminHeaven

the admin heaven
Type:
admin.AdminHeaven

componentHeaven

the component heaven
Type:
component.ComponentHeaven

dispatcher

dispatcher to create avatars
Type:
Dispatcher

logCategory

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

workerHeaven

the worker heaven
Type:
worker.WorkerHeaven

Generated by Epydoc 2.1 on Sat Apr 14 13:16:52 2007 http://epydoc.sf.net