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

Class Vishnu

source code

common.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
 
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
 
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
 
_makeBouncer(self, conf, identity) source code
 
_addManagerPlug(self, socket, args, identity) source code
 
_addManagerPlugs(self, _, conf, identity) source code
flumotion.common.planet.ManagerComponentState
_addComponent(self, conf, parent, identity)
Add a component state for the given component config entry.
source code
 
_updateFlowDependencies(self, state) 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, conf, identity) source code
 
_loadConfiguration(self, conf, identity) source code
 
loadConfigurationXML(self, file, identity)
Load the configuration from the given XML, merging it on top of the currently running 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
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, type, conf) source code
 
_createCallback(self, result, componentState) source code
 
_createErrback(self, failure, state) source code
 
workerDetached(self, workerAvatar) source code
 
_getComponentState(self, deferredListResult, avatar) source code
 
componentAttached(self, componentAvatar) source code
 
componentDetached(self, componentAvatar) 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
 
deleteFlow(self, *args, **kwargs)
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

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

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

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

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

loadConfigurationXML(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.

_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: 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, *args, **kwargs)

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.

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 0x956348c>