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

Class HTTPStreamingResource

source code

twisted.web.resource.Resource --+
                                |
      common.log.Loggable --+   |
                            |   |
 base.http.HTTPAuthentication --+
                                |
          common.log.Loggable --+
                                |
                               HTTPStreamingResource

Nested Classes [hide private]

Inherited from twisted.web.resource.Resource: entityType

Instance Methods [hide private]
 
__init__(self, streamer)
Initialize.
source code
 
_streamer_client_removed_cb(self, streamer, sink, fd, reason, stats) 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
 
_writeHeaders(self, 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
 
reachedMaxClients(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
 
clientDone(self, fd) source code
 
handleAuthenticatedRequest(self, res, request) source code
 
_render(self, request)
Default handling of HEAD method.
source code
 
authenticateKeycard(self, bouncerName, keycard) source code
 
cleanupKeycard(self, bouncerName, keycard) source code
 
_handleNotReady(self, request) source code
 
_handleMaxClients(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 base.http.HTTPAuthentication: authenticate, cleanupAuth, expireKeycard, setBouncerName, setDefaultDuration, setDomain, setIssuerClass, setRequesterId, startAuthentication

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

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)
(Constructor)

source code 

Initialize.

Parameters:
Overrides: base.http.HTTPAuthentication.__init__

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

clientDone(self, fd)

source code 
Overrides: base.http.HTTPAuthentication.clientDone

authenticateKeycard(self, bouncerName, keycard)

source code 
Overrides: base.http.HTTPAuthentication.authenticateKeycard

cleanupKeycard(self, bouncerName, keycard)

source code 
Overrides: base.http.HTTPAuthentication.cleanupKeycard

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)