globus_connect_gridftp_server  15.97
Typedefs
Callback Type Signatures

Typedefs

typedef globus_result_t(* globus_dsi_rest_response_t) (void *response_callback_arg, int response_code, const char *response_status, const globus_dsi_rest_key_array_t *response_headers)
 Response Callback Signature. More...
 
typedef globus_result_t(* globus_dsi_rest_write_t) (void *write_callback_arg, void *buffer, size_t buffer_length, size_t *amount_copied)
 Data Write Callback Signature. More...
 
typedef globus_result_t(* globus_dsi_rest_read_t) (void *read_callback_arg, void *buffer, size_t buffer_length)
 Data Read Callback Signature. More...
 
typedef void(* globus_dsi_rest_complete_t) (void *complete_callback_arg, globus_result_t result)
 Request Complete Callback Signature. More...
 
typedef globus_result_t(* globus_dsi_rest_progress_t) (void *progress_callback_arg, uint64_t total_read, uint64_t amt_read, uint64_t total_written, uint64_t amt_written)
 Request Progress Callback Signature. More...
 

Detailed Description

Typedef Documentation

◆ globus_dsi_rest_complete_t

typedef void(* globus_dsi_rest_complete_t) (void *complete_callback_arg, globus_result_t result)

Request Complete Callback Signature.

This is the type signature for the callback to be called upon completion of processing an entire REST request.

This function is called once after all other callbacks related to the request have returned and includes the final status of the request.

Parameters
[in]complete_callback_argDSI-specific data passed to the request operation.
[in]resultThe final status of the request.

◆ globus_dsi_rest_progress_t

typedef globus_result_t(* globus_dsi_rest_progress_t) (void *progress_callback_arg, uint64_t total_read, uint64_t amt_read, uint64_t total_written, uint64_t amt_written)

Request Progress Callback Signature.

This is the type signature for the callback to be called periodically during processing a REST request.

This function is called regularly to provide progress information for a request. This may be useful for providing application feedback, or for checking for idle timeouts.

Below is one specialized implementation of this function to cover the common case of an idle timeout.

Parameters
[in]progress_callback_argDSI-specific data passed to the request operation.
[in]total_readTotal amount of data expected to be read during processing this request if known, otherwise 0.
[in]amt_readAmount of data read so far processing this request.
[in]total_writtenTotal amount of data expected to be writte during processing this request if known, otherwise 0.
[in]amt_writtenAmount of data written so far processing this request.
Returns
The DSI should return GLOBUS_SUCCESS to allow processing to continue. Otherwise, the REST operation will be aborted and the result will be returned from the request.

◆ globus_dsi_rest_read_t

typedef globus_result_t(* globus_dsi_rest_read_t) (void *read_callback_arg, void *buffer, size_t buffer_length)

Data Read Callback Signature.

This is the type signature for the callback to read data FROM the REST server (i.e., to read the body of a reply from a server). This is typically needed for GET, POST, or PATCH requests.

This function is called repeatedly by the DSI REST Helper API to send a part of the data from the REST server, until the function returns an error or there is no more data. In a non-error situation, the final call to this function will be with a buffer_length of 0.

Below are some specialized implementations of this function to cover some common cases for clients (such as receiving a json response, and pushing data from a REST response to a GridFTP control channel for a DSI operation).

Parameters
[in]read_callback_argDSI-specific data passed to the request operation.
[in,out]bufferA buffer provided by the DSI REST API. The DSI processes the REST payload data from this buffer.
[in]buffer_lengthThe amount of the array pointed to by the buffer parameter. The final time this is called for a particular operation, the value is 0.
Returns
The DSI should return GLOBUS_SUCCESS to allow processing to continue. Otherwise, the REST operation will be aborted and the result will be returned from the request.

◆ globus_dsi_rest_response_t

typedef globus_result_t(* globus_dsi_rest_response_t) (void *response_callback_arg, int response_code, const char *response_status, const globus_dsi_rest_key_array_t *response_headers)

Response Callback Signature.

This is the type signature for the response callback. The response callback is called called by the request processor when it receives the HTTP response code, status, and headers. This is called after the request body is sent in the write callbacks, and before the response body is received and parsed in the read callbacks.

Parameters
[in]response_callback_argDSI-specific callback argument.
[in]response_codeHTTP response code. This is typically a 3 digit number (200, 404, etc), but may be the special value 0 in the case of a protocol error.
[in]response_statusHTTP response status. This is typically a short string like ("Ok", "Continue", "Not Found", etc).
[in]response_headersThe set of headers included in the response.
Returns
The DSI should return GLOBUS_SUCCESS to allow processing to continue. Otherwise, the REST operation will be aborted and the result will be returned from the request.

◆ globus_dsi_rest_write_t

typedef globus_result_t(* globus_dsi_rest_write_t) (void *write_callback_arg, void *buffer, size_t buffer_length, size_t *amount_copied)

Data Write Callback Signature.

This is the type signature for the callback to write data TO the REST server (i.e., to send the body of a request to a server). This is typically needed for POST, PATCH, or PUT requests.

This function is called repeatedly by the DSI REST Helper API to send a part of the data to the REST server, until the function returns an error or sets the value pointed to by amount_copied to 0.

Below are some specialized implementations of this function to cover some common cases for clients (such as sending data from a GridFTP control channel for a DSI operation).

Parameters
[in]write_callback_argDSI-specific data passed to the request operation.
[in,out]bufferA buffer provided by the DSI REST API. The DSI copies REST payload data into this buffer.
[in]buffer_lengthThe length of the array pointed to by the buffer parameter.
[out]amount_copiedThe amount of data copied into buffer by this call. The DSI may set this to 0 to signal end of file.
Returns
The DSI should return GLOBUS_SUCCESS to allow processing to continue. Otherwise, the REST operation will be aborted and the result will be returned from the request.