CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HttpObjectFetcher< CatalogT, HistoryT, ReflogT > Class Template Reference

#include <object_fetcher.h>

Inheritance diagram for HttpObjectFetcher< CatalogT, HistoryT, ReflogT >:
Collaboration diagram for HttpObjectFetcher< CatalogT, HistoryT, ReflogT >:

Public Types

typedef BaseTN::Failures Failures
 
- Public Types inherited from AbstractObjectFetcher< HttpObjectFetcher< CatalogT, HistoryT, ReflogT > >
typedef object_fetcher_traits
< HttpObjectFetcher< CatalogT,
HistoryT, ReflogT >
>::CatalogTN 
CatalogTN
 
typedef object_fetcher_traits
< HttpObjectFetcher< CatalogT,
HistoryT, ReflogT >
>::HistoryTN 
HistoryTN
 
typedef object_fetcher_traits
< HttpObjectFetcher< CatalogT,
HistoryT, ReflogT >
>::ReflogTN 
ReflogTN
 
typedef
ObjectFetcherFailures::Failures 
Failures
 
- Public Types inherited from ObjectFetcherFailures
enum  Failures {
  kFailOk, kFailNotFound, kFailLocalIO, kFailNetwork,
  kFailDecompression, kFailManifestNameMismatch, kFailManifestSignatureMismatch, kFailBadData,
  kFailUnknown, kFailNumEntries
}
 

Public Member Functions

 HttpObjectFetcher (const std::string &repo_name, const std::string &repo_url, const std::string &temp_dir, download::DownloadManager *download_mgr, signature::SignatureManager *signature_mgr)
 
Failures FetchManifest (manifest::Manifest **manifest)
 
std::string GetUrl (const shash::Any &hash) const
 
Failures Fetch (const shash::Any &object_hash, std::string *object_file)
 
Failures Fetch (const std::string &relative_path, const bool decompress, const bool nocache, std::string *file_path)
 
- Public Member Functions inherited from AbstractObjectFetcher< HttpObjectFetcher< CatalogT, HistoryT, ReflogT > >
Failures FetchManifest (manifest::Manifest **manifest)
 
Failures FetchManifest (UniquePtr< manifest::Manifest > *manifest)
 
Failures FetchHistory (HistoryTN **history, const shash::Any &history_hash=shash::Any())
 
Failures FetchHistory (UniquePtr< HistoryTN > *history, const shash::Any &history_hash=shash::Any())
 
Failures FetchCatalog (const shash::Any &catalog_hash, const std::string &catalog_path, CatalogTN **catalog, const bool is_nested=false, CatalogTN *parent=NULL)
 
Failures FetchCatalog (const shash::Any &catalog_hash, const std::string &catalog_path, UniquePtr< CatalogTN > *catalog, const bool is_nested=false, CatalogTN *parent=NULL)
 
Failures FetchReflog (const shash::Any &reflog_hash, ReflogTN **reflog)
 
Failures FetchReflog (const shash::Any &reflog_hash, UniquePtr< ReflogTN > *reflog)
 
std::string GetUrl (const shash::Any &hash) const
 
bool HasHistory ()
 
const std::string & temporary_directory () const
 

Protected Types

typedef HttpObjectFetcher
< CatalogT, HistoryT, ReflogT > 
ThisTN
 
typedef AbstractObjectFetcher
< ThisTN
BaseTN
 

Protected Member Functions

std::string BuildUrl (const std::string &relative_path) const
 
std::string BuildRelativeUrl (const shash::Any &hash) const
 
Failures Download (const std::string &relative_path, const bool decompress, const bool nocache, const shash::Any *expected_hash, std::string *file_path)
 
- Protected Member Functions inherited from AbstractObjectFetcher< HttpObjectFetcher< CatalogT, HistoryT, ReflogT > >
 AbstractObjectFetcher (const std::string &temp_dir)
 
Failures Fetch (const shash::Any &object_hash, std::string *file_path)
 
Failures Fetch (const std::string &relative_path, const bool decompress, const bool nocache, std::string *file_path)
 
shash::Any GetHistoryHash ()
 

Private Attributes

const std::string repo_url_
 
const std::string repo_name_
 
download::DownloadManagerdownload_manager_
 
signature::SignatureManagersignature_manager_
 

Additional Inherited Members

- Static Public Attributes inherited from AbstractObjectFetcher< HttpObjectFetcher< CatalogT, HistoryT, ReflogT > >
static const std::string kManifestFilename
 
static const std::string kReflogFilename
 

Detailed Description

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
class HttpObjectFetcher< CatalogT, HistoryT, ReflogT >

This implements the AbstractObjectFetcher<> to retrieve repository objects from a remote location through HTTP. It verifies the repository's signature and the downloaded data integrity.

Definition at line 452 of file object_fetcher.h.

Member Typedef Documentation

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
typedef AbstractObjectFetcher<ThisTN> HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::BaseTN
protected

Definition at line 457 of file object_fetcher.h.

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
typedef BaseTN::Failures HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Failures

Definition at line 460 of file object_fetcher.h.

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
typedef HttpObjectFetcher<CatalogT, HistoryT, ReflogT> HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::ThisTN
protected

Definition at line 456 of file object_fetcher.h.

Constructor & Destructor Documentation

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::HttpObjectFetcher ( const std::string &  repo_name,
const std::string &  repo_url,
const std::string &  temp_dir,
download::DownloadManager download_mgr,
signature::SignatureManager signature_mgr 
)
inline

HttpObjectFetcher<> contains external DownloadManager and SignatureManager hence it essentially is a wrapper object and can be copied.

Parameters
repo_namethe name of the repository to download objects from
repo_urlthe URL to the repository's backend storage
temp_dirlocation to store decompressed tmp data
download_mgrpointer to the download manager to be used
signature_mgrpointer to the signature manager to be used
Returns
a HttpObjectFetcher<> object or NULL on error

Definition at line 475 of file object_fetcher.h.

Member Function Documentation

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
std::string HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::BuildRelativeUrl ( const shash::Any hash) const
inlineprotected

Definition at line 560 of file object_fetcher.h.

Referenced by HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Fetch(), and HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::GetUrl().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
std::string HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::BuildUrl ( const std::string &  relative_path) const
inlineprotected
template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
Failures HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Download ( const std::string &  relative_path,
const bool  decompress,
const bool  nocache,
const shash::Any expected_hash,
std::string *  file_path 
)
inlineprotected

Definition at line 564 of file object_fetcher.h.

Referenced by HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Fetch().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
Failures HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Fetch ( const shash::Any object_hash,
std::string *  object_file 
)
inline

Definition at line 536 of file object_fetcher.h.

Here is the call graph for this function:

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
Failures HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::Fetch ( const std::string &  relative_path,
const bool  decompress,
const bool  nocache,
std::string *  file_path 
)
inline

Definition at line 546 of file object_fetcher.h.

Here is the call graph for this function:

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
Failures HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::FetchManifest ( manifest::Manifest **  manifest)
inline

Definition at line 488 of file object_fetcher.h.

Referenced by swissknife::CommandGc::Main(), swissknife::CommandReconstructReflog::Main(), and swissknife::CommandListReflog::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
std::string HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::GetUrl ( const shash::Any hash) const
inline

Definition at line 532 of file object_fetcher.h.

Here is the call graph for this function:

Member Data Documentation

template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
download::DownloadManager* HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::download_manager_
private
template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
const std::string HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::repo_name_
private
template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
const std::string HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::repo_url_
private
template<class CatalogT = catalog::Catalog, class HistoryT = history::SqliteHistory, class ReflogT = manifest::Reflog>
signature::SignatureManager* HttpObjectFetcher< CatalogT, HistoryT, ReflogT >::signature_manager_
private

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