bes  Updated for version 3.20.6
cmr::RemoteHttpResource Class Reference

#include <RemoteHttpResource.h>

Collaboration diagram for cmr::RemoteHttpResource:
Collaboration graph

Public Member Functions

std::string get_http_response_header (const std::string header_name)
 
std::string getCacheFileName ()
 
std::vector< std::string > * getResponseHeaders ()
 
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 49 of file cmr_module/RemoteHttpResource.h.

Constructor & Destructor Documentation

◆ RemoteHttpResource()

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 cmr_module/RemoteHttpResource.cc.

◆ ~RemoteHttpResource()

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 92 of file cmr_module/RemoteHttpResource.cc.

Member Function Documentation

◆ get_http_response_header()

std::string 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 384 of file cmr_module/RemoteHttpResource.cc.

◆ getCacheFileName()

std::string cmr::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 121 of file cmr_module/RemoteHttpResource.h.

◆ getResponseHeaders()

std::vector<std::string>* cmr::RemoteHttpResource::getResponseHeaders ( )
inline

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

Definition at line 135 of file cmr_module/RemoteHttpResource.h.

◆ getType()

std::string cmr::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 112 of file cmr_module/RemoteHttpResource.h.

◆ retrieveResource()

void 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 130 of file cmr_module/RemoteHttpResource.cc.


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