It provides various get and set methods to control the properties of a transfer
that is about to restart.
Methods
|
|
|
|
__del__
|
__del__ ( self )
Destroy an instance.
Destroys the underlying handle, and deactivates the module.
Raises:
A RestartMarkerException is thrown if unable to deactivate
the module.
|
|
__init__
|
__init__ ( self, handle=None )
Constructs an instance.
Activates the globus ftp client module, and creates the underlying handle.
Arguments:
Raises:
A RestartMarkerException is thrown if unable to initialize the
module, or create the handle.
|
|
copy
|
copy ( self )
Creates a deep copy of iteself.
Raises:
A RestartMarker is thrown if unable to make the copy.
Returns:
A new RestartMarker object with the same attributes as
the old is returned.
|
|
from_string
|
from_string ( self, markerStr )
Initialize the marker from a string.
Raises:
A RestartMarkerException is thrown if unable to initialize
the marker from the given string.
|
|
get_handle
|
get_handle ( self )
Return the underlying ftp client restart marker 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_total
|
get_total ( self )
Get total bytes accounted for in restart marker.
This funtion will return the sum of all bytes accounted for in a restart
marker. If this restart marker contains a stream offset then this value
is the same as the offset (not the ascii offset) that it was set with. If it
is a range list, it a sum of all the bytes in the ranges.
Raises:
A RestartMarkerException is thrown if unable to get the
total bytes.
Returns:*
The total bytes in the marker..
|
|
insert_range
|
insert_range (
self,
offset,
endOffset,
)
Insert a range into the marker.
This method updates the marker with a new byte range, suitable for using
to restart an extended block mode transfer. Adjacent ranges within the marker
will be combined into a single entry in the marker.
A marker can only hold a range list or a stream offset. Calling this method after
calling set_offset() will result in a marker suitable only for use restarting an
extended block mode transfer.
Arguments:
offset The beginning offset to start at. This may be an int or a python
long, if your platform supports 64 bit files.
endOffset The offset to end at.
Raises:
A RestartMarkerException is thrown if unable to insert the
restart range.
|
|
set_ascii_offset
|
set_ascii_offset (
self,
offset,
asciiOffset,
)
Set the offset for a restart marker.
This method modifies the marker to contain a stream offset, suitable for
using to restart a steam mode transfer.
A marker can only hold a range list or a stream offset. Calling this method after
calling insert_range() will delete the ranges associated with the marker, and
replace it with a marker suitable only for use restarting a stream mode transfer.
When restarting an ASCII type transfer, use this method to set both the offset
used in the local representation of an ACSII file, and the network representation
of the ASCII file. For UNIX systems, the former includes counts newlines as one
character towards the file offset, and the latter counts them as 2 characters
(CRLF).
Arguments:
Raises:
A RestartMarkerException is thrown if unable to set the
ASCII offset.
|
|
set_offset
|
set_offset ( self, offset )
Insert the offset to restart at.
This method modifies the marker to contain a stream offset, suitable for
using to restart a steam mode transfer.
A marker can only hold a range list or a stream offset. Calling this method after
calling insert_range() will delete the ranges associated with the marker, and
replace it with a marker suitable only for use restarting a stream mode transfer.
When restarting an ASCII type transfer, the offset must take into account the
additional carriage return characters added to the data stream.
Arguments:
Raises:
A RestartMarkerException is thrown if unable to set the
offset.
|
|
to_string
|
to_string ( self )
Return a string represenation of the marker.
Returns a string suitable for sending to the FTP REST command, or for a
later call to from_string().
Raises:
A RestartMarkerException is thrown if unable to get the
marker string.
Returns:*
A string representation of the marker.
|