bes  Updated for version 3.20.6
gateway::RemoteHttpResource Class Reference

#include <RemoteHttpResource.h>

Collaboration diagram for gateway::RemoteHttpResource:
Collaboration graph

Public Member Functions

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 gateway_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 50 of file gateway_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 86 of file gateway_module/RemoteHttpResource.cc.

Member Function Documentation

◆ getCacheFileName()

std::string gateway::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 118 of file gateway_module/RemoteHttpResource.h.

◆ getResponseHeaders()

std::vector<std::string>* gateway::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 129 of file gateway_module/RemoteHttpResource.h.

◆ getType()

std::string gateway::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 109 of file gateway_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 124 of file gateway_module/RemoteHttpResource.cc.


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