Package flumotion :: Package component :: Package consumers :: Package httpstreamer :: Module resources :: Class HTTPStreamingResource
[hide private]

Class HTTPStreamingResource

source code

twisted.web.resource.Resource --+
                                |
      extern.log.log.Loggable --+
                                |
                               HTTPStreamingResource

Nested Classes [hide private]

Inherited from twisted.web.resource.Resource: entityType

Instance Methods [hide private]
 
__init__(self, streamer, httpauth)
Initialize.
source code
 
clientRemoved(self, sink, fd, reason, stats) source code
 
removeAllClients(self)
Start to remove all the clients connected (this will complete asynchronously from another thread)
source code
 
setRoot(self, path) source code
 
setLogFilter(self, logfilter) source code
 
rotateLogs(self)
Close the logfile, then reopen using the previous logfilename
source code
 
logWrite(self, fd, ip, request, stats) source code
 
setUserLimit(self, limit) source code
 
setBandwidthLimit(self, limit) source code
 
setRedirectionOnLimits(self, url) source code
boolean
_writeHeaders(self, request)
Write out the HTTP headers for the incoming HTTP request.
source code
 
isReady(self) source code
 
getMaxAllowedClients(self, maxclients)
maximum number of allowed clients based on soft limit for number of open file descriptors and fd reservation.
source code
 
reachedServerLimits(self) source code
 
_addClient(self, request)
Add a request, so it can be used for statistics.
source code
 
_logRequestFromIP(self, ip)
Returns whether we want to log a request from this IP; allows us to filter requests from automated monitoring systems.
source code
 
_removeClient(self, request, fd, stats)
Removes a request and add logging.
source code
 
handleAuthenticatedRequest(self, res, request) source code
 
_render(self, request)
Default handling of HEAD method.
source code
 
_handleNotReady(self, request) source code
 
_handleServerFull(self, request) source code
 
_handleNewClient(self, request) source code
 
render_GET(self, request)
Default handling of HEAD method.
source code
 
render_HEAD(self, request)
Default handling of HEAD method.
source code

Inherited from twisted.web.resource.Resource: __providedBy__, delEntity, getChild, getChildForRequest, getChildWithDefault, getDynamicEntity, getStaticEntity, listDynamicEntities, listDynamicNames, listEntities, listNames, listStaticEntities, listStaticNames, putChild, reallyPutEntity, render

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

Class Variables [hide private]
  __reserve_fds__ = 50
  logCategory = 'httpstreamer'
Implementors can provide a category to log their messages under.
  isLeaf = True

Inherited from twisted.web.resource.Resource: __implemented__, __provides__, server

Method Details [hide private]

__init__(self, streamer, httpauth)
(Constructor)

source code 

Initialize.

Parameters:
Overrides: twisted.web.resource.Resource.__init__

removeAllClients(self)

source code 

Start to remove all the clients connected (this will complete asynchronously from another thread)

Returns a deferred that will fire once they're all removed.

_writeHeaders(self, request)

source code 

Write out the HTTP headers for the incoming HTTP request.

Returns: boolean
whether or not the file descriptor can be used further.

getMaxAllowedClients(self, maxclients)

source code 

maximum number of allowed clients based on soft limit for number of open file descriptors and fd reservation. Increases soft limit to hard limit if possible.

_addClient(self, request)

source code 

Add a request, so it can be used for statistics.

Parameters:
  • request (twisted.protocol.http.Request) - the request

_removeClient(self, request, fd, stats)

source code 

Removes a request and add logging. Note that it does not disconnect the client; it is called in reaction to a client disconnecting. It also removes the keycard if one was created.

Parameters:
  • request (twisted.protocols.http.Request) - the request
  • fd (int) - the file descriptor for the client being removed
  • stats (GValueArray) - the statistics for the removed client

render_HEAD(self, request)

source code 

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

Overrides: twisted.web.resource.Resource.render_HEAD
(inherited documentation)