Package flumotion :: Package component :: Package misc :: Package httpserver :: Module httpserver :: Class HTTPFileStreamer
[hide private]

Class HTTPFileStreamer

source code

             object --+        
                      |        
common.common.InitMixin --+    
                          |    
extern.log.log.Loggable --+    
                          |    
    component.BaseComponent --+
                              |
    extern.log.log.Loggable --+
                              |
                             HTTPFileStreamer

Nested Classes [hide private]
child class of BaseComponentMedium componentMediumClass
the medium class to use for this component
Instance Methods [hide private]
 
init(self)
A subclass should do as little as possible in its init method.
source code
 
do_check(self)
Subclasses can implement me to run any checks before the component performs setup.
source code
 
have_properties(self, props) source code
 
do_setup(self)
Subclasses can implement me to set up the component before it is started.
source code
 
do_stop(self)
BaseComponent vmethod for stopping.
source code
 
updatePorterDetails(self, path, username, password)
Provide a new set of porter login information, for when we're in slave mode and the porter changes.
source code
 
_updatePath(self, path) source code
 
_timeoutRequests(self) source code
 
_getDefaultRootResource(self) source code
 
_createRootResourceForPath(self, path, fileResource) source code
 
remove_client(self, fd)
Remove a client when requested.
source code
 
remove_all_clients(self) source code
 
requestStarted(self, request) source code
 
requestFinished(self, request, bytesWritten, timeConnected, fd) source code
 
getDescription(self) source code
 
getUrl(self) source code
 
getStreamData(self) source code
 
getLoadData(self)
Return a tuple (deltaadded, deltaremoved, bytes_transferred, current_clients, current_load) of our current bandwidth and user values.
source code
 
rotateLog(self)
Close the logfile, then reopen using the previous logfilename
source code
 
setRootResource(self, resource)
Attaches a root resource to this component.
source code
 
getMountPoint(self)
Get the mount point of this component
source code

Inherited from component.BaseComponent: __init__, addMessage, adminCallRemote, check_properties, fixRenamedProperties, getMood, getName, getWorkerName, setMedium, setMood, setShutdownHook, setWorkerName, setup, setup_completed, stop, waitForHappy

Inherited from component.BaseComponent (private): _pollCPU, _pollMemory

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

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

Class Variables [hide private]
  REQUEST_TIMEOUT = 30
  __implemented__ = <implementedBy flumotion.component.misc.http...
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from component.BaseComponent: logCategory

Instance Variables [hide private]

Inherited from component.BaseComponent: medium, name, uiState

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

init(self)

source code 

A subclass should do as little as possible in its init method. In particular, it should not try to access resources.

Failures during init are marshalled back to the manager through the worker's remote_create method, since there is no component state proxied to the manager yet at the time of init.

Overrides: component.BaseComponent.init
(inherited documentation)

do_check(self)

source code 

Subclasses can implement me to run any checks before the component performs setup.

Messages can be added to the component state's 'messages' list key. Any error messages added will trigger the component going to sad, with flumotion.common.errors.ComponentSetupError being raised before getting to setup stage; do_setup() will not be called.

In the event of a fatal problem that can't be expressed through an error message, this method should raise an exception or return a failure.

It is not necessary to chain up in this function. The return value may be a deferred.

Overrides: component.BaseComponent.do_check
(inherited documentation)

do_setup(self)

source code 

Subclasses can implement me to set up the component before it is started. It should set up the component, possibly opening files and resources. Non-programming errors should not be raised, but returned as a failing deferred.

The return value may be a deferred.

Overrides: component.BaseComponent.do_setup
(inherited documentation)

do_stop(self)

source code 

BaseComponent vmethod for stopping. The component should do any cleanup it needs, but must not set the component's mood to sleeping.

Returns:
twisted.internet.defer.Deferred
Overrides: component.BaseComponent.do_stop
(inherited documentation)

updatePorterDetails(self, path, username, password)

source code 

Provide a new set of porter login information, for when we're in slave mode and the porter changes. If we're currently connected, this won't disconnect - it'll just change the information so that next time we try and connect we'll use the new ones

Parameters:
  • path - new path
  • username - new username
  • password - new password

remove_client(self, fd)

source code 

Remove a client when requested.

Used by keycard expiry.

getLoadData(self)

source code 

Return a tuple (deltaadded, deltaremoved, bytes_transferred, current_clients, current_load) of our current bandwidth and user values. The deltas and current_load are NOT currently implemented here, we set them as zero.

setRootResource(self, resource)

source code 

Attaches a root resource to this component. The root resource is the once which will be used when accessing the mount point. This is normally called from a plugs start() method.

Parameters:
  • resource (twisted.web.resource.Resource) - root resource

getMountPoint(self)

source code 

Get the mount point of this component

Returns:
the mount point

Class Variable Details [hide private]

__implemented__

Value:
<implementedBy flumotion.component.misc.httpserver.httpserver.HTTPFile\
Streamer>

__provides__

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