Package pyGlobus :: Module gassTransfer :: Class TransferServer
[show private | hide private]
[frames | no frames]

Class TransferServer

TransferData --+
               |
              TransferServer


A class to accept and handle requests
Method Summary
  __init__(self, scheme)
  __del__(self)
frees the memory associated with the callaback handles
  authorize(self, request, length)
After the server has accepted a request it can authorize the request if it wants the transfer to proceed
  deny(self, request, reason, message)
After the server has accepted the request it can deny the request if it does not want the transfer to proceed.
  get_base_url(self)
Calls the listener's get base url function
  register_accept(self, attr, callback, arg)
Has the server accept an incoming client request This function should be called after the callback for register_listen has been called.
  register_listen(self, callback, arg)
Has the server listen for incoming client request
    Inherited from TransferData
  free_callback(self, cbHandle)
Free a callback.
  receive_bytes(self, request, buffer, wait_for_amount, callback, arg)
Return a SWIG'ized pointer to the callback handle is returned.
  send_bytes(self, request, buffer, eof, callback, arg)
After authorizing a request the server calls send bytes which sends the data in the buffer object

Method Details

__init__(self, scheme)
(Constructor)

Parameters:
scheme - is a string of the protocol that will be used
Overrides:
pyGlobus.gassTransfer.TransferData.__init__

__del__(self)
(Destructor)

frees the memory associated with the callaback handles
Overrides:
pyGlobus.gassTransfer.TransferData.__del__ (inherited documentation)

authorize(self, request, length=0)

After the server has accepted a request it can authorize the request if it wants the transfer to proceed
Parameters:
request - a server side request returned from the register_accept call
length - the number of bytes that the request is authorized to make the default 0, will use GLOBUS_GASS_TRANSFER_LENGTH_UNKNOWN
Returns:
returns a TransferRequest object which will be needed for a send_bytes call
Raises:
TransferServerException - A TransferServerException if the request cannnot be authorized

deny(self, request, reason, message)

After the server has accepted the request it can deny the request if it does not want the transfer to proceed.
Parameters:
request - a server side request returned from the register_accept call
reason - an int which is a protocol specific error code
message - a string which is the message given why the request was denied.
Returns:
returns a TransferRequest object which will be needed for a send_bytes call
Raises:
TransferServerException - A TransferServerException if the request cannnot be denied.

get_base_url(self)

Calls the listener's get base url function

register_accept(self, attr, callback, arg)

Has the server accept an incoming client request This function should be called after the callback for register_listen has been called.

Does not block
Parameters:
attr - a ListenerAttr object
callback - the function that will be called as soon a client request is registered
arg - a user supplied argument to the callback function
Returns:
A TransferRequest object is returned the request object is a server request
Raises:
GassTransferServerException - A GassTransferServerException is raised if the server is unable to accept this client request

register_listen(self, callback, arg)

Has the server listen for incoming client request

Does not block
Parameters:
callback - the function that will be called as soon a a client request is registered
arg - a user supplied argument to the callback function
Returns:
None
Raises:
GassTransferServerException - A GassTransferServerException is raised if the server is unable to listen for client requests

Generated by Epydoc 2.1 on Tue Apr 4 14:32:53 2006 http://epydoc.sf.net