Package AccessGrid :: Module DataStore :: Class GSIHTTPTransferServer
[show private | hide private]
[frames | no frames]

Class GSIHTTPTransferServer

BaseServer --+        
             |        
  GSITCPServer --+    
                 |    
GSITCPSocketServer --+
                     |
    TransferServer --+
                     |
                    GSIHTTPTransferServer


A GSIHTTPTransferServer is a Globus-enabled HTTP-based implementation of a TransferServer.

Note that most of the work is done in HTTPTransferHandler.

This implementation uses a pool of worker threads to handle the requests. We could just use SocketServer.ThreadingMixIn, but I worry about an unbounded number of incoming request overloading the server.

self.requestQueue is a Queue object. Each worker thread runs __WorkerRun(), which blocks on a get on teh request queue.

Incoming requests are just placed on the queue.
Method Summary
  __init__(self, address, numThreads, sslCompat)
  GetDownloadDescriptor(self, prefix, path)
Return the download descriptor for this transfer server.
  GetIdentityToken(self, transferHandler)
Create an identity token for this GSIHTTP-based transfer.
  GetUploadDescriptor(self, prefix)
Return the upload descriptor for this transfer server.
  process_request(self, request, client_address)
Call finish_request.
  run(self)
  stop(self)
  thread_run(self)
thread_run is the server thread's main function.
  __WorkerRun(self, workerNum)
  _CreateWorkers(self)
  _GetListenPort(self)
    Inherited from GSITCPSocketServer
  server_close(self)
Called to clean-up the server.
    Inherited from GSITCPServer
  close_request(self, request)
Called to clean up an individual request.
  fileno(self)
Return socket file number.
  get_delegated_credential(self)
  get_request(self)
Get the request and client address from the socket.
  server_activate(self)
Called by constructor to activate the server.
  server_bind(self)
Called by constructor to bind the socket.
    Inherited from BaseServer
  finish_request(self, request, client_address)
Finish one request by instantiating RequestHandlerClass.
  handle_error(self, request, client_address)
Handle an error gracefully.
  handle_request(self)
Handle one request, possibly blocking.
  serve_forever(self)
Handle one request at a time until doomsday.
  verify_request(self, request, client_address)
Verify the request.
    Inherited from TransferServer
  LookupPrefix(self, prefix)
  LookupUploadInformation(self, transfer_key, file_num)
Look up the information for transfer_key and file_num in the manifest.
  RegisterManifest(self, manifest)
A client has sent a POST to /<prefix>/manifest to initiate an upload.
  RegisterPrefix(self, prefix, handler)

Class Variable Summary
    Inherited from GSITCPServer
int address_family = 2                                                                     
int allow_reuse_address = 0                                                                     
int request_queue_size = 5                                                                     
int socket_type = 1                                                                     

Method Details

GetDownloadDescriptor(self, prefix, path)

Return the download descriptor for this transfer server.

Must be implemented by the protocol-specific subclass.
Overrides:
AccessGrid.DataStore.TransferServer.GetDownloadDescriptor (inherited documentation)

GetIdentityToken(self, transferHandler)

Create an identity token for this GSIHTTP-based transfer.

It contains the DN from the connection's security context.

GetUploadDescriptor(self, prefix)

Return the upload descriptor for this transfer server.

Must be implemented by the protocol-specific subclass.
Overrides:
AccessGrid.DataStore.TransferServer.GetUploadDescriptor (inherited documentation)

process_request(self, request, client_address)

Call finish_request.

Overridden by ForkingMixIn and ThreadingMixIn.
Overrides:
SocketServer.BaseServer.process_request (inherited documentation)

thread_run(self)

thread_run is the server thread's main function.

Generated by Epydoc 2.1 on Thu Apr 14 16:39:31 2005 http://epydoc.sf.net