bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
http::EffectiveUrl Class Reference

#include <EffectiveUrl.h>

Inheritance diagram for http::EffectiveUrl:
Inheritance graph
Collaboration diagram for http::EffectiveUrl:
Collaboration graph

Public Types

using kvp_map_t = std::map<std::string, std::vector<std::string>>
 

Public Member Functions

std::string dump () override
 A string dump of the instance.
 
 EffectiveUrl (const EffectiveUrl &src_url)=default
 
 EffectiveUrl (const http::url &src_url)
 
 EffectiveUrl (const std::shared_ptr< http::EffectiveUrl > &source_url)
 
 EffectiveUrl (const std::shared_ptr< http::EffectiveUrl > &source_url, bool trusted)
 
 EffectiveUrl (const std::string &url_s, bool trusted)
 
 EffectiveUrl (const std::string &url_s, const std::vector< std::string > &resp_hdrs, bool trusted=false)
 
void get_header (const std::string &name, std::string &value, bool &found)
 get the value of the named header
 
virtual std::string host () const
 
void ingest_response_headers (const std::vector< std::string > &resp_hdrs)
 Replaces the existing header names and values with the new response headers.
 
virtual std::time_t ingest_time () const
 
bool is_expired () override
 Returns true if URL is reusable, false otherwise.
 
virtual bool is_trusted () const
 
virtual std::string path () const
 
virtual std::string protocol () const
 
virtual std::string query () const
 
virtual std::string query_parameter_value (const std::string &key) const
 Get the value of a query string key.
 
virtual const std::vector< std::string > & query_parameter_values (const std::string &key) const
 Get the vector of query string values for a given key.
 
virtual size_t query_parameter_values_size (const std::string &key) const
 Return the number of query string values for a given key .
 
virtual void set_ingest_time (const std::time_t &itime)
 
virtual std::string str () const
 

Detailed Description

An EffectiveUrl is always acquired by following redirects and so may include response headers received with the final redirect response.

Definition at line 48 of file EffectiveUrl.h.

Member Typedef Documentation

◆ kvp_map_t

using http::url::kvp_map_t = std::map<std::string, std::vector<std::string>>
inherited

Definition at line 46 of file url_impl.h.

Constructor & Destructor Documentation

◆ EffectiveUrl() [1/5]

http::EffectiveUrl::EffectiveUrl ( const std::string & url_s,
bool trusted )
inline

Definition at line 60 of file EffectiveUrl.h.

◆ EffectiveUrl() [2/5]

http::EffectiveUrl::EffectiveUrl ( const std::string & url_s,
const std::vector< std::string > & resp_hdrs,
bool trusted = false )
inline

Definition at line 61 of file EffectiveUrl.h.

◆ EffectiveUrl() [3/5]

http::EffectiveUrl::EffectiveUrl ( const http::url & src_url)
inlineexplicit

Definition at line 66 of file EffectiveUrl.h.

◆ EffectiveUrl() [4/5]

http::EffectiveUrl::EffectiveUrl ( const std::shared_ptr< http::EffectiveUrl > & source_url)
inlineexplicit

Definition at line 68 of file EffectiveUrl.h.

◆ EffectiveUrl() [5/5]

http::EffectiveUrl::EffectiveUrl ( const std::shared_ptr< http::EffectiveUrl > & source_url,
bool trusted )
inlineexplicit

Definition at line 72 of file EffectiveUrl.h.

Member Function Documentation

◆ dump()

string http::EffectiveUrl::dump ( )
overridevirtual

A string dump of the instance.

Returns
A string containing readable instance state.

Reimplemented from http::url.

Definition at line 156 of file EffectiveUrl.cc.

◆ get_header()

void http::EffectiveUrl::get_header ( const std::string & name,
std::string & value,
bool & found )

get the value of the named header

Parameters
nameName of header value to retrieve
valueA return value parameter into which the value will be written.
foundA returned value parameter set to true if a value associated wit the header name is located, false otherwise.

Definition at line 111 of file EffectiveUrl.cc.

◆ host()

virtual std::string http::url::host ( ) const
inlinevirtualinherited

Definition at line 105 of file url_impl.h.

◆ ingest_response_headers()

void http::EffectiveUrl::ingest_response_headers ( const std::vector< std::string > & resp_hdrs)

Replaces the existing header names and values with the new response headers.

Parameters
resp_hdrsThe response headers to ingest.

Definition at line 131 of file EffectiveUrl.cc.

◆ ingest_time()

virtual std::time_t http::url::ingest_time ( ) const
inlinevirtualinherited

Definition at line 111 of file url_impl.h.

◆ is_expired()

bool http::EffectiveUrl::is_expired ( )
overridevirtual

Returns true if URL is reusable, false otherwise.

Returns
Returns true if the query string parameters or response headers received with the EffectiveUrl indicate that the URL may be reused. False otherwise

Reimplemented from http::url.

Definition at line 65 of file EffectiveUrl.cc.

◆ is_trusted()

virtual bool http::url::is_trusted ( ) const
inlinevirtualinherited

Definition at line 124 of file url_impl.h.

◆ path()

virtual std::string http::url::path ( ) const
inlinevirtualinherited

Definition at line 107 of file url_impl.h.

◆ protocol()

virtual std::string http::url::protocol ( ) const
inlinevirtualinherited

Definition at line 103 of file url_impl.h.

◆ query()

virtual std::string http::url::query ( ) const
inlinevirtualinherited

Definition at line 109 of file url_impl.h.

◆ query_parameter_value()

string http::url::query_parameter_value ( const std::string & key) const
virtualinherited

Get the value of a query string key.

Parameters
keyKey for the KVP query params
Returns
The associated value for the key or an empty string if the key is not found.

Definition at line 167 of file url_impl.cc.

◆ query_parameter_values()

const vector< string > & http::url::query_parameter_values ( const std::string & key) const
virtualinherited

Get the vector of query string values for a given key.

Parameters
keyKey for the KVP query params
Returns
Return a const reference to a string of values. Throws BESInternalError if the key is not found.
See also
query_parameter_values_size() to test if the key is present.

Definition at line 198 of file url_impl.cc.

◆ query_parameter_values_size()

size_t http::url::query_parameter_values_size ( const std::string & key) const
virtualinherited

Return the number of query string values for a given key .

Parameters
keyKey for the KVP query params
Returns
Return the number of values or zero if the key is not found.

Definition at line 183 of file url_impl.cc.

◆ set_ingest_time()

virtual void http::url::set_ingest_time ( const std::time_t & itime)
inlinevirtualinherited

Definition at line 115 of file url_impl.h.

◆ str()

virtual std::string http::url::str ( ) const
inlinevirtualinherited

Definition at line 101 of file url_impl.h.


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