bes  Updated for version 3.20.6
httpd_catalog::RemoteHttpResource Class Reference

#include <RemoteHttpResource.h>

Collaboration diagram for httpd_catalog::RemoteHttpResource:
Collaboration graph

Public Member Functions

std::string get_http_response_header (const std::string header_name)
 
std::string getCacheFileName ()
 
void getResponseHeaders (std::vector< std::string > &hdrs)
 
std::string getType ()
 
 RemoteHttpResource (const std::string &url)
 
void retrieveResource ()
 
virtual ~RemoteHttpResource ()
 

Detailed Description

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 44 of file httpd_catalog_module/RemoteHttpResource.h.

Constructor & Destructor Documentation

◆ RemoteHttpResource()

httpd_catalog::RemoteHttpResource::RemoteHttpResource ( const std::string &  url)

Builds a RemoteHttpResource object associated with the passed url parameter.

Parameters
urlIs a URL string that identifies the remote resource.

Definition at line 57 of file httpd_catalog_module/RemoteHttpResource.cc.

◆ ~RemoteHttpResource()

httpd_catalog::RemoteHttpResource::~RemoteHttpResource ( )
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 101 of file httpd_catalog_module/RemoteHttpResource.cc.

Member Function Documentation

◆ get_http_response_header()

string httpd_catalog::RemoteHttpResource::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 406 of file httpd_catalog_module/RemoteHttpResource.cc.

◆ getCacheFileName()

std::string httpd_catalog::RemoteHttpResource::getCacheFileName ( )
inline

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 114 of file httpd_catalog_module/RemoteHttpResource.h.

◆ getResponseHeaders()

void httpd_catalog::RemoteHttpResource::getResponseHeaders ( std::vector< std::string > &  hdrs)
inline

Returns a std::vector of HTTP headers received along with the response from the request for the remote resource..

Definition at line 127 of file httpd_catalog_module/RemoteHttpResource.h.

◆ getType()

std::string httpd_catalog::RemoteHttpResource::getType ( )
inline

Returns the DAP type std::string of the RemoteHttpResource

Returns
Returns the DAP type std::string used by the BES Containers.

Definition at line 105 of file httpd_catalog_module/RemoteHttpResource.h.

◆ retrieveResource()

void httpd_catalog::RemoteHttpResource::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 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.

Definition at line 139 of file httpd_catalog_module/RemoteHttpResource.cc.


The documentation for this class was generated from the following files: