GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/server_tool.h
Date: 2024-04-28 02:33:07
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
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;
31 manifest::Failures FetchRemoteManifestEnsemble(
32 const std::string &repository_url, const std::string &repository_name,
33 manifest::ManifestEnsemble *ensemble) const;
34 manifest::Manifest *FetchRemoteManifest(
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
46 download::DownloadManager *download_manager() const;
47 signature::SignatureManager *signature_manager() const;
48 24 perf::Statistics *statistics() { return &statistics_; }
49 const perf::Statistics *statistics() const { return &statistics_; }
50
51 protected:
52 UniquePtr<download::DownloadManager> download_manager_;
53 UniquePtr<signature::SignatureManager> signature_manager_;
54 perf::Statistics statistics_;
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_
64