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

Class AdminAvatar

        Loggable --+    
                   |    
  Avatar --+       |    
           |       |    
Loggable --+       |    
           |       |    
      Avatar --+   |    
               |   |    
  PingableAvatar --+    
                   |    
       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.
Method Summary
  attached(self, mind)
Tell the avatar that the given mind has been attached.
  detached(self, mind)
Tell the avatar that the peer's client referenced by the mind has detached.
list of planet.ManagerComponentState getComponentStates(self)
Return all component states logged in to the manager.
  perspective_cleanComponents(self)
twisted.internet.defer.Deferred perspective_componentCallRemote(self, componentState, methodName, *args, **kwargs)
Call a method on the given component on behalf of an admin client.
  perspective_componentRestart(self, componentState)
Restart the given component.
  perspective_componentStart(self, componentState)
Start the given component.
  perspective_componentStop(self, componentState)
Stop the given component.
  perspective_deleteComponent(self, componentState)
Delete a component from the manager.
  perspective_deleteFlow(self, flowName)
str perspective_getConfiguration(self)
Get the configuration of the manager as an XML string.
  perspective_getEntryByType(self, componentState, type)
Get the entry point for a piece of bundled code by the type.
flumotion.common.planet.ManagerPlanetState perspective_getPlanetState(self)
Get the planet state.
flumotion.common.worker.ManagerWorkerHeavenState perspective_getWorkerHeavenState(self)
Get the worker heaven state.
  perspective_loadConfiguration(self, xml, saveAs)
Load the given XML configuration into the manager.
  perspective_reloadComponent(self, componentState)
Reload modules in the given component.
  perspective_reloadManager(self)
Reload modules in the manager.
  perspective_shutdown(self)
Shut down the manager.
  perspective_workerCallRemote(self, workerName, methodName, *args, **kwargs)
Call a remote method on the worker.
  perspectiveMessageReceived(self, broker, message, args, kwargs)
  sendLog(self, category, type, message)
Send the given log message to the peer.
    Inherited from ManagerAvatar
  __init__(self, heaven, avatarId, remoteIdentity)
  disconnect(self)
Disconnect the remote PB client.
str or None getClientAddress(self)
Get the IPv4 address of the machine the PB client is connecting from, as seen from the avatar.
bool hasRemoteReference(self)
Check if the avatar has a remote reference to the peer.
  mindCallRemote(self, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
  perspective_authenticate(self, bouncerName, keycard)
Authenticate the given keycard.
list of (str, str) tuples of (bundleName, md5sum) perspective_getBundleSums(self, bundleName, fileName, moduleName)
Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
list of (str, str) tuples perspective_getBundleSumsByFile(self, filename)
Get a list of (bundleName, md5sum) of all dependency bundles, starting with this bundle, in the correct order.
dict of str -> str perspective_getBundleZips(self, bundles)
Get the zip files for the given list of bundles.
twisted.internet.defer.Deferred firing list of str perspective_getKeycardClasses(self)
Get the keycard classes the manager's bouncer can authenticate.
  timeoutDisconnect(self)
    Inherited from PingableAvatar
  perspective_ping(self)
  setMind(self, mind)
Tell the avatar that the given mind has been attached.
  startPingChecking(self, disconnect)
  stopPingChecking(self)
    Inherited from Avatar
  mindCallRemoteLogging(self, level, stackDepth, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
    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.

Instance Variable Summary
    Inherited from ManagerAvatar
str avatarId: the id for this avatar, unique inside the heaven
flumotion.manager.base.ManagerHeaven heaven: the heaven this avatar is part of
twisted.spread.pb.RemoteReference mind: a remote reference to the client-side Medium
flumotion.manager.manager.Vishnu vishnu: the vishnu that manages this avatar's heaven

Class Variable Summary
str logCategory: Implementors can provide a category to log their messages under.
    Inherited from ManagerAvatar
str remoteLogName: name to use to log the other side of the connection
    Inherited from Avatar
Implements __implemented__ = <implementedBy twisted.spread.pb.Avata...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

attached(self, mind)

Tell the avatar that the given mind has been attached. This gives the avatar a way to call remotely to the client that requested this avatar. This is scheduled by the portal after the client has logged in.
Parameters:
mind
           (type=twisted.spread.pb.RemoteReference)
Overrides:
flumotion.manager.base.ManagerAvatar.attached (inherited documentation)

detached(self, mind)

Tell the avatar that the peer's client referenced by the mind has detached.

Called through the manager's PB logout trigger calling flumotion.manager.manager.Dispatcher.removeAvatar
Parameters:
mind
           (type=twisted.spread.pb.RemoteReference)
Overrides:
flumotion.manager.base.ManagerAvatar.detached (inherited documentation)

getComponentStates(self)

Return all component states logged in to the manager. The list gets serialized to a list of flumotion.common.planet.AdminComponentState
Returns:
list of planet.ManagerComponentState

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

Call a method on the given component on behalf of an admin client.
Parameters:
componentState - state of the component to call the method on
           (type=planet.ManagerComponentState)
methodName - name of the method to call. Gets proxied to flumotion.component.component.BaseComponentMedium's remote_(methodName)
           (type=str)
Returns:
twisted.internet.defer.Deferred

perspective_componentRestart(self, componentState)

Restart the given component.
Parameters:
componentState
           (type=planet.ManagerComponentState)

perspective_componentStart(self, componentState)

Start the given component. The component should be sleeping before this.
Parameters:
componentState
           (type=planet.ManagerComponentState)

perspective_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)

perspective_deleteComponent(self, componentState)

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_getConfiguration(self)

Get the configuration of the manager as an XML string.
Returns:
str

perspective_getEntryByType(self, componentState, type)

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

Returns: a (filename, methodName) tuple, or raises a Failure

perspective_getPlanetState(self)

Get the planet state.
Returns:
flumotion.common.planet.ManagerPlanetState

perspective_getWorkerHeavenState(self)

Get the worker heaven state.
Returns:
flumotion.common.worker.ManagerWorkerHeavenState

perspective_loadConfiguration(self, xml, saveAs=None)

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 - the XML configuration snippet.
           (type=str)
saveAs - The name of a file to save the XML as.
           (type=str)

perspective_reloadComponent(self, componentState)

Reload modules in the given component.
Parameters:
componentState - state of the component to reload
           (type=planet.ManagerComponentState)

perspective_reloadManager(self)

Reload modules in the manager.

perspective_shutdown(self)

Shut down the manager.

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

Call a remote method on the worker. This is used so that admin clients can call methods from the interface to the worker.
Parameters:
workerName - the worker to call
           (type=str)
methodName - Name of the method to call. Gets proxied to flumotion.worker.worker.WorkerMedium 's remote_(methodName)
           (type=str)

sendLog(self, category, type, message)

Send the given log message to the peer.

Class Variable Details

logCategory

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

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