CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
server_tool.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_SERVER_TOOL_H_
6 #define CVMFS_SERVER_TOOL_H_
7 
8 #include <string>
9 
10 #include "crypto/signature.h"
11 #include "manifest_fetch.h"
12 #include "network/download.h"
13 #include "reflog.h"
14 #include "statistics.h"
15 #include "util/pointer.h"
16 
17 class ServerTool {
18  public:
19  ServerTool();
20  virtual ~ServerTool();
21 
22  bool InitDownloadManager(const bool follow_redirects,
23  const std::string &proxy,
24  const unsigned max_pool_handles = 1);
25  bool InitVerifyingSignatureManager(const std::string &pubkey_path);
26  bool InitSigningSignatureManager(const std::string &certificate_path,
27  const std::string &private_key_path,
28  const std::string &private_key_password);
29 
30  manifest::Manifest *OpenLocalManifest(const std::string path) const;
32  const std::string &repository_url, const std::string &repository_name,
33  manifest::ManifestEnsemble *ensemble) const;
35  const std::string &repository_url, const std::string &repository_name,
36  const shash::Any &base_hash = shash::Any()) const;
37 
38  template <class ObjectFetcherT>
39  manifest::Reflog *FetchReflog(ObjectFetcherT *object_fetcher,
40  const std::string &repo_name,
41  const shash::Any &reflog_hash);
42 
43  manifest::Reflog *CreateEmptyReflog(const std::string &temp_directory,
44  const std::string &repo_name);
45 
49  const perf::Statistics *statistics() const { return &statistics_; }
50 
51  protected:
55 
56  private:
57  static const unsigned kDownloadTimeout = 60; // 1 minute
58  static const unsigned kDownloadRetries = 3; // 4 attempts in total
59 };
60 
61 #include "server_tool_impl.h"
62 
63 #endif // CVMFS_SERVER_TOOL_H_
perf::Statistics statistics_
Definition: server_tool.h:54
static const unsigned kDownloadTimeout
Definition: server_tool.h:57
UniquePtr< download::DownloadManager > download_manager_
Definition: server_tool.h:52
manifest::Reflog * FetchReflog(ObjectFetcherT *object_fetcher, const std::string &repo_name, const shash::Any &reflog_hash)
static const unsigned kDownloadRetries
Definition: server_tool.h:58
manifest::Manifest * FetchRemoteManifest(const std::string &repository_url, const std::string &repository_name, const shash::Any &base_hash=shash::Any()) const
Definition: server_tool.cc:126
bool InitVerifyingSignatureManager(const std::string &pubkey_path)
Definition: server_tool.cc:44
manifest::Failures FetchRemoteManifestEnsemble(const std::string &repository_url, const std::string &repository_name, manifest::ManifestEnsemble *ensemble) const
Definition: server_tool.cc:116
signature::SignatureManager * signature_manager() const
Definition: server_tool.cc:106
download::DownloadManager * download_manager() const
Definition: server_tool.cc:101
perf::Statistics * statistics()
Definition: server_tool.h:48
const perf::Statistics * statistics() const
Definition: server_tool.h:49
UniquePtr< signature::SignatureManager > signature_manager_
Definition: server_tool.h:53
manifest::Manifest * OpenLocalManifest(const std::string path) const
Definition: server_tool.cc:111
virtual ~ServerTool()
Definition: server_tool.cc:11
manifest::Reflog * CreateEmptyReflog(const std::string &temp_directory, const std::string &repo_name)
Definition: server_tool.cc:168
bool InitDownloadManager(const bool follow_redirects, const std::string &proxy, const unsigned max_pool_handles=1)
Definition: server_tool.cc:17
bool InitSigningSignatureManager(const std::string &certificate_path, const std::string &private_key_path, const std::string &private_key_password)
Definition: server_tool.cc:62