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

#include <EffectiveUrlCache.h>

Inheritance diagram for http::EffectiveUrlCache:
Inheritance graph
Collaboration diagram for http::EffectiveUrlCache:
Collaboration graph

Public Member Functions

void dump (std::ostream &strm) const override
 dumps information about this object
 
 EffectiveUrlCache (const EffectiveUrlCache &src)=delete
 
std::shared_ptr< EffectiveUrlget_effective_url (std::shared_ptr< url > source_url)
 
EffectiveUrlCacheoperator= (const EffectiveUrlCache &rhs)=delete
 

Static Public Member Functions

static EffectiveUrlCacheTheCache ()
 Get the singleton EffectiveUrlCache instance.
 

Friends

class EffectiveUrlCacheTest
 

Detailed Description

This is a singleton class. It is used to associate a URL with its "effective" URL. This means that when a URL is dereferenced the request may go through a potentially large number of redirect actions before the requested resource is retrieved. This final location, from which the requested bytes are transmitted, is termed the "effective url" and that is stored in an in memory cache (std::map) so that later requests may skip the redirects and just get required bytes from the actual source.

Note
This is the same as following a chain HTTP redirects to get the URL to the origin of the data.

Definition at line 53 of file EffectiveUrlCache.h.

Member Function Documentation

◆ dump()

void http::EffectiveUrlCache::dump ( std::ostream & strm) const
overridevirtual

dumps information about this object

Parameters
strmC++ i/o stream to dump the information to

Implements BESObj.

Definition at line 192 of file EffectiveUrlCache.cc.

◆ get_effective_url()

shared_ptr< EffectiveUrl > http::EffectiveUrlCache::get_effective_url ( std::shared_ptr< url > source_url)

Find the terminal (effective) url for the source_url. If the source_url matches the skip_regex then it will not be cached.

Parameters
source_url
Returns
The effective URL

Definition at line 75 of file EffectiveUrlCache.cc.

◆ TheCache()

static EffectiveUrlCache * http::EffectiveUrlCache::TheCache ( )
inlinestatic

Get the singleton EffectiveUrlCache instance.

This static method returns the instance of this singleton class. The implementation will only build one instance of EffectiveUrlCache and thereafter return a pointer to that instance.

Thread safe with C++-11 and greater.

Returns
A pointer to the EffectiveUrlCache singleton

Definition at line 85 of file EffectiveUrlCache.h.

Friends And Related Symbol Documentation

◆ EffectiveUrlCacheTest

friend class EffectiveUrlCacheTest
friend

Definition at line 72 of file EffectiveUrlCache.h.


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