Provides a simple interface to protocol independent file transfers.
Wraps the globus gass copy module. Supports http, https, ftp, and
gsiftp based transfers.
Methods
|
|
|
|
__del__
|
__del__ ( self )
Destroy an instance.
Free any outstanding callback handles, destroy the underlying gass
copy handle, and deactivate the module.
Raises:
A GassCopyException is thrown if unable to destroy the handle
or deactivate the module.
|
|
__init__
|
__init__ (
self,
handleAttr,
handle=None,
)
Constructs an instance.
Activates the gass copy module, and then creates the underlying
gass copy handle.
Arguments:
handleAttr A HandleAttr object.
handle An optional argument that if present will be used as
the gass copy handle. The class then owns the handle, and will
delete it at destruction.
Raises:
A GassCopyException is thrown if unable to initialize the module
or create the handle.
|
|
cache_url_state
|
cache_url_state ( self, url )
Cache a connection to a server.
When an URL is cached, the connection to the server will not be closed
after a file transfer completes.
Arguments:
url The URL to be cached.
Raises:
A GassCopyException is thrown if an error occurs while
caching the url.
|
|
copy_handle_to_url
|
copy_handle_to_url (
self,
srcHandle,
destUrl,
destAttr,
)
Transfer data from a io handle to a URL.
Currently the only types of handles implemented are file io handles.
This method blocks until the transfer is complete.
Arguments:
srcHandle A globus_io_handle_t SWIG pointer. Currently
these are returned from the io file methods. The data will
be read from here.
destUrl The URL to transfer the data to.
destAttr A Attr object with the attributes for the
destination.
Raises:
A GassCopyException is thrown if an error occurs while
attempting to copy the data.
|
|
copy_url_to_handle
|
copy_url_to_handle (
self,
srcUrl,
srcAttr,
destHandle,
)
Transfer data from a source URL to a io handle.
Currently the only types of handles implemented are file io handles.
This method blocks until the transfer is complete.
Arguments:
srcUrl The URL to transfer data from.
srcAttr A Attr object with the attributes for the
source.
destHandle A globus_io_handle_t SWIG pointer. Currently
these are returned from the io file methods.
Raises:
A GassCopyException is thrown if an error occurs while
attempting to copy the data.
|
|
copy_url_to_url
|
copy_url_to_url (
self,
srcUrl,
srcAttr,
destUrl,
destAttr,
)
Transfer data from source url to destination url.
The url's may be http, https, ftp, and gsiftp. This method
blocks until the transfer is complete.
Arguments:
srcUrl The URL to transfer the data from.
srcAttr A Attr object with the attributes
for the source.
destUrl The URL to transfer data to.
destAttr A Attr object with the attributes
for the destination.
Raises:
A GassCopyException is thrown if an error occurs while
attempting to copy the data.
|
|
flush_url_state
|
flush_url_state ( self, url )
Remove a cached connection.
If an idle connection to an FTP server exists, it will be closed.
Arguments:
Raises:
A GassCopyException is thrown if an error occurs
while flushing the url.
|
|
free_callback
|
free_callback ( self, cbHandle )
Free the callbacks resources.
Free's the memory allocated to hold the callback structure.
Arguments:
|
|
get_handle
|
get_handle ( self )
Return the underlying gass copy handle.
XXX This handle is only valid as long as this object exists. When
the object is destroyed, the memory this handle points to is freed.
Returns:
A string containing the pointer.
|
|
get_status
|
get_status ( self )
Return the current status.
Returns a status code describing the state of the current transfer.
Raises:
A GassCopyException is thrown if unable to return the status.
Returns:
A status code. The possible codes are defined above in
the module constants
|
|
register_copy_handle_to_url
|
register_copy_handle_to_url (
self,
srcHandle,
destUrl,
destAttr,
callback,
arg,
)
Transfer data from a io handle to a URL.
Asynchronously transfers the data. Currently the only types of handles
implemented are file io handles.
Arguments:
srcHandle A globus_io_handle_t SWIG pointer. Currently
these are returned from the io file methods. The data will
be read from here.
destUrl The URL to transfer the data to.
destAttr A Attr object with the attributes for the
destination.
callback The function to call when the transfer is
complete. It has the following form.
function(arg, handle, error) where arg is the user
argument passed into this call, handle is the gass
copy handle, and error is a string containging either
NONE or an error message.
arg A user argument to be passed to the callback
function.
Raises:
A GassCopyException is thrown if an error occurs while
initiating the copy.
|
|
register_copy_url_to_handle
|
register_copy_url_to_handle (
self,
srcUrl,
srcAttr,
destHandle,
callback,
arg,
)
Transfer data from a source URL to a io handle.
Currently the only types of handles implemented are file io handles.
This method blocks until the transfer is complete.
Arguments:
srcUrl The URL to transfer data from.
srcAttr A Attr object with the attributes for the
source.
destHandle A globus_io_handle_t SWIG pointer. Currently
these are returned from the io file methods.
callback The function to call when the transfer is
complete. It has the following form.
function(arg, handle, error) where arg is the user
argument passed into this call, handle is the gass
copy handle, and error is a string containging either
NONE or an error message.
arg A user argument to be passed to the callback
function.
Raises:
A GassCopyException is thrown if an error occurs while
initiating the copy.
|
|
register_copy_url_to_url
|
register_copy_url_to_url (
self,
srcUrl,
srcAttr,
destUrl,
destAttr,
callback,
arg,
)
Transfer data from source url to destination url.
Asynchronously transfer data between two url's.
Arguments:
srcUrl The URL to transfer the data from.
srcAttr A Attr object with the attributes
for the source.
destUrl The URL to transfer data to.
destAttr A Attr object with the attributes
for the destination.
callback The function to call when the transfer is
complete. It has the following form.
function(arg, handle, error) where arg is the user
argument passed into this call, handle is the gass
copy handle, and error is a string containging either
NONE or an error message.
arg A user argument to be passed to the callback
function.
Raises:
A GassCopyException is thrown if an error occurs
while initiating the transfer.
|
|