bes
Updated for version 3.20.8
|
#include <RemoteResource.h>
Public Member Functions | |
rapidjson::Document | get_as_json () |
get_as_json() This function returns the cached resource parsed into a JSON document. More... | |
std::string | get_http_response_header (const std::string header_name) |
std::string | get_response_as_string () |
std::string | getCacheFileName () |
std::vector< std::string > * | getResponseHeaders () |
std::string | getType () |
RemoteResource (const std::string &url, const std::string &uid="") | |
void | retrieveResource () |
void | retrieveResource (const std::string &template_key, const std::string &replace_value) |
virtual | ~RemoteResource () |
This class encapsulates a remote resource available via HTTP GET. It will retrieve the content of the resource and place it in a local disk cache for rapid (subsequent) access. It can be configure to use a proxy server for the outgoing requests.
Definition at line 50 of file RemoteResource.h.
|
virtual |
Releases any memory resources and also any existing cache file locks for the cached resource. ( Closes the file descriptor opened when retrieveResource() was called.)
Definition at line 201 of file RemoteResource.cc.
rapidjson::Document http::RemoteResource::get_as_json | ( | ) |
get_as_json() This function returns the cached resource parsed into a JSON document.
target_url | The URL to dereference. @TODO Move this to ../curl_utils.cc (Requires moving the rapidjson lib too) |
Definition at line 636 of file RemoteResource.cc.
std::string http::RemoteResource::get_http_response_header | ( | const std::string | header_name | ) |
Returns the value of the requested HTTP response header. Evaluation is case-insensitive. If the requested header_name is not found the empty string is returned.
Definition at line 539 of file RemoteResource.cc.
std::string http::RemoteResource::get_response_as_string | ( | ) |
Returns cache file content in a string..
Definition at line 599 of file RemoteResource.cc.
std::string http::RemoteResource::getCacheFileName | ( | ) |
Returns the (read-locked) cache file name on the local system in which the content of the remote resource is stored. Deleting of the instance of this class will release the read-lock.
Definition at line 234 of file RemoteResource.cc.
vector< string > * http::RemoteResource::getResponseHeaders | ( | ) |
Returns a std::vector of HTTP headers received along with the response from the request for the remote resource..
Definition at line 646 of file RemoteResource.cc.
|
inline |
Returns the DAP type std::string of the RemoteHttpResource
Definition at line 133 of file RemoteResource.h.
void http::RemoteResource::retrieveResource | ( | ) |
This method will check the cache for the resource. If it's not there then it will lock the cache and retrieve the remote resource content using HTTP GET.
When this method returns the RemoteResource object is fully initialized and the cache file name for the resource is available along with an open file descriptor for the (now read-locked) cache file.
Definition at line 249 of file RemoteResource.cc.
void http::RemoteResource::retrieveResource | ( | const std::string & | template_key, |
const std::string & | replace_value | ||
) |
This method will check the cache for the resource. If it's not there then it will lock the cache and retrieve the remote resource content using HTTP GET.
When this method returns the RemoteHttpResource object is fully initialized and the cache file name for the resource is available along with an open file descriptor for the (now read-locked) cache file.
uid | |
template_key | |
replace_value |
Definition at line 266 of file RemoteResource.cc.