Package flumotion :: Package component :: Package misc :: Package porter :: Module porter :: Class HTTPPorterProtocol
[hide private]

Class HTTPPorterProtocol

source code

twisted.internet.protocol.BaseProtocol --+        
                                         |        
        twisted.internet.protocol.Protocol --+    
                                             |    
                   extern.log.log.Loggable --+    
                                             |    
                                PorterProtocol --+
                                                 |
                                                HTTPPorterProtocol
Known Subclasses:

Instance Methods [hide private]
 
parseLine(self, line)
Parse the initial line of the request.
source code
 
unparseLine(self, parsed)
Recreate the initial request line from the parsed representation.
source code
 
generateRequestId(self)
Return a string that will uniquely identify the request.
source code
 
injectRequestId(self, parsed, requestId)
Take the parsed representation of the first request line and a string token, return a parsed representation of the request line with the request-id possibly mixed into it.
source code
 
extractIdentifier(self, parsed)
Extract a string that uniquely identifies the requested stream from the parsed representation of the first request line.
source code
 
writeNotFoundResponse(self)
Write a response indicating that the requested resource was not found in this protocol.
source code
 
writeServiceUnavailableResponse(self)
Write a response indicating that the requested resource was temporarily uavailable in this protocol.
source code

Inherited from PorterProtocol: __init__, connectionLost, connectionMade, dataReceived

Inherited from PorterProtocol (private): _timeout

Inherited from twisted.internet.protocol.Protocol: __provides__, logPrefix

Inherited from twisted.internet.protocol.BaseProtocol: __providedBy__, makeConnection

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

Class Variables [hide private]
  scheme = 'http'
  protos = ['HTTP/1.0', 'HTTP/1.1']
  requestIdParameter = 'FLUREQID'
  requestIdBitsNo = 256

Inherited from PorterProtocol: MAX_SIZE, PORTER_CLIENT_TIMEOUT, delimiters, logCategory

Inherited from twisted.internet.protocol.Protocol: __implemented__

Inherited from twisted.internet.protocol.BaseProtocol: connected, transport

Method Details [hide private]

parseLine(self, line)

source code 

Parse the initial line of the request. Return an object that can be used to uniquely identify the stream being requested by passing it to extractIdentifier, or None if the request is unreadable.

Subclasses should override this.

Overrides: PorterProtocol.parseLine
(inherited documentation)

unparseLine(self, parsed)

source code 

Recreate the initial request line from the parsed representation. The recreated line does not need to be exactly identical, but both parsedLine(unparseLine(line)) and line should contain the same information (i.e. unparseLine should not lose information).

UnparseLine has to return a valid line from the porter protocol's scheme point of view (for instance, HTTP).

Subclasses should override this.

Overrides: PorterProtocol.unparseLine
(inherited documentation)

generateRequestId(self)

source code 

Return a string that will uniquely identify the request.

Subclasses should override this if they want to use request-ids and also implement injectRequestId.

Overrides: PorterProtocol.generateRequestId
(inherited documentation)

injectRequestId(self, parsed, requestId)

source code 

Take the parsed representation of the first request line and a string token, return a parsed representation of the request line with the request-id possibly mixed into it.

Subclasses should override this if they generate request-ids.

Overrides: PorterProtocol.injectRequestId
(inherited documentation)

extractIdentifier(self, parsed)

source code 

Extract a string that uniquely identifies the requested stream from the parsed representation of the first request line.

Subclasses should override this, depending on how they implemented parseLine.

Overrides: PorterProtocol.extractIdentifier
(inherited documentation)

writeNotFoundResponse(self)

source code 

Write a response indicating that the requested resource was not found in this protocol.

Subclasses should override this to use the correct protocol.

Overrides: PorterProtocol.writeNotFoundResponse
(inherited documentation)

writeServiceUnavailableResponse(self)

source code 

Write a response indicating that the requested resource was temporarily uavailable in this protocol.

Subclasses should override this to use the correct protocol.

Overrides: PorterProtocol.writeServiceUnavailableResponse
(inherited documentation)