libzypp 17.38.5

refresh.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#ifndef ZYPP_NG_REPO_REFRESH_INCLUDED
10#define ZYPP_NG_REPO_REFRESH_INCLUDED
11
12#include <zypp-core/ng/async/task.h>
13#include <zypp-core/ng/pipelines/Expected>
14#include <zypp-core/ng/base/Signals>
15#include <zypp-core/fs/TmpPath.h>
16
17#include <zypp/RepoInfo.h>
18#include <zypp/RepoManagerOptions.h>
19#include <zypp/RepoManagerFlags.h>
20#include <zypp/ng/repomanager.h>
21#include <zypp/repo/PluginRepoverification.h>
22
23
24 namespace zyppng {
25 ZYPP_FWD_DECL_TYPE_WITH_REFS( Context );
26 ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
27}
28
29 namespace zyppng::repo {
30
31 ZYPP_FWD_DECL_TYPE_WITH_REFS (RefreshContext);
32
33 using RawMetadataRefreshPolicy = zypp::RepoManagerFlags::RawMetadataRefreshPolicy;
34 using RefreshCheckStatus = zypp::RepoManagerFlags::RefreshCheckStatus;
35
42 class RefreshContext : public Base {
43 ZYPP_ADD_PRIVATE_CONSTR_HELPER();
44 public:
45 using ProvideType = typename Context::ProvideType;
46 using PluginRepoverification = zypp_private::repo::PluginRepoverification;
47
48 static expected<repo::RefreshContextRef> create( ContextRef zyppContext, zypp::RepoInfo info, RepoManagerRef repoManager );
49 ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ContextRef &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef &&repoManager );
50
51 ~RefreshContext() override;
52
58 void saveToRawCache();
59
63 const zypp::Pathname &rawCachePath() const;
64
70 zypp::Pathname targetDir() const;
71
76 const ContextRef &zyppContext () const;
77
83 const zypp::RepoInfo &repoInfo () const;
84 zypp::RepoInfo &repoInfo ();
85
89 const RepoManagerRef &repoManager() const;
90 const zypp::RepoManagerOptions &repoManagerOptions() const;
91
95 RawMetadataRefreshPolicy policy() const;
96 void setPolicy(RawMetadataRefreshPolicy newPolicy);
97
101 const std::optional<PluginRepoverification> &pluginRepoverification() const;
102
103 void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
104 { _pluginRepoverification = std::move(pluginRepoverification_r); }
105
109 void setNoPluginRepoverification()
110 { setPluginRepoverification( std::nullopt ); }
111
116 void setProbedType( zypp::repo::RepoType rType );
117 const std::optional<zypp::repo::RepoType> &probedType() const;
118 SignalProxy<void(zypp::repo::RepoType)> sigProbedTypeChanged();
119
120 private:
121 ContextRef _zyppContext;
122 RepoManagerRef _repoManager;
123 zypp::RepoInfo _repoInfo;
124 zypp::Pathname _rawCachePath;
125 zypp::filesystem::TmpDir _tmpDir;
126 repo::RawMetadataRefreshPolicy _policy = RawMetadataRefreshPolicy::RefreshIfNeeded;
127 std::optional<PluginRepoverification> _pluginRepoverification;
128
129 std::optional<zypp::repo::RepoType> _probedType;
130 Signal<void(zypp::repo::RepoType)> _sigProbedTypeChanged;
131
132 };
133}
134#endif
PluginRepoverification.h
RepoInfo.h
RepoManagerFlags.h
RepoManagerOptions.h
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::filesystem::TmpDir
Provide a new empty temporary directory and recursively delete it when no longer needed.
Definition TmpPath.h:173
zypp_private::repo::PluginRepoverification
Repository metadata verification beyond GPG.
Definition PluginRepoverification.h:53
zyppng::Base::Base
Base()
Definition base.cc:20
zyppng::Context
Definition context.h:27
zyppng::Context::ProvideType
Provide ProvideType
Definition context.h:34
zyppng::SignalProxy
Definition signals.h:325
zyppng::Signal
Definition signals.h:151
zyppng::expected
Definition expected.h:56
zyppng::repo::RefreshContext
Definition refresh.h:42
zyppng::repo::RefreshContext::setPolicy
void setPolicy(RawMetadataRefreshPolicy newPolicy)
Definition refresh.cc:129
zyppng::repo::RefreshContext::setNoPluginRepoverification
void setNoPluginRepoverification()
Definition refresh.h:109
zyppng::repo::RefreshContext::_repoManager
RepoManagerRef _repoManager
Definition refresh.h:122
zyppng::repo::RefreshContext::setPluginRepoverification
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition refresh.h:103
zyppng::repo::RefreshContext::rawCachePath
const zypp::Pathname & rawCachePath() const
Definition refresh.cc:81
zyppng::repo::RefreshContext::targetDir
zypp::Pathname targetDir() const
Definition refresh.cc:87
zyppng::repo::RefreshContext::_repoInfo
zypp::RepoInfo _repoInfo
Definition refresh.h:123
zyppng::repo::RefreshContext::_rawCachePath
zypp::Pathname _rawCachePath
Definition refresh.h:124
zyppng::repo::RefreshContext::repoInfo
const zypp::RepoInfo & repoInfo() const
Definition refresh.cc:99
zyppng::repo::RefreshContext::policy
RawMetadataRefreshPolicy policy() const
Definition refresh.cc:123
zyppng::repo::RefreshContext::ZYPP_DECL_PRIVATE_CONSTR_ARGS
ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ContextRef &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef &&repoManager)
zyppng::repo::RefreshContext::_zyppContext
ContextRef _zyppContext
Definition refresh.h:121
zyppng::repo::RefreshContext::pluginRepoverification
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition refresh.cc:135
zyppng::repo::RefreshContext::_policy
repo::RawMetadataRefreshPolicy _policy
Definition refresh.h:126
zyppng::repo::RefreshContext::_probedType
std::optional< zypp::repo::RepoType > _probedType
Definition refresh.h:129
zyppng::repo::RefreshContext::ZYPP_ADD_PRIVATE_CONSTR_HELPER
ZYPP_ADD_PRIVATE_CONSTR_HELPER()
zyppng::repo::RefreshContext::repoManager
const RepoManagerRef & repoManager() const
Definition refresh.cc:111
zyppng::repo::RefreshContext::ProvideType
typename Context::ProvideType ProvideType
Definition refresh.h:45
zyppng::repo::RefreshContext::_pluginRepoverification
std::optional< PluginRepoverification > _pluginRepoverification
Definition refresh.h:127
zyppng::repo::RefreshContext::sigProbedTypeChanged
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
Definition refresh.cc:157
zyppng::repo::RefreshContext::create
static expected< repo::RefreshContextRef > create(ContextRef zyppContext, zypp::RepoInfo info, RepoManagerRef repoManager)
Definition refresh.cc:31
zyppng::repo::RefreshContext::_tmpDir
zypp::filesystem::TmpDir _tmpDir
Definition refresh.h:125
zyppng::repo::RefreshContext::repoManagerOptions
const zypp::RepoManagerOptions & repoManagerOptions() const
Definition refresh.cc:117
zyppng::repo::RefreshContext::setProbedType
void setProbedType(zypp::repo::RepoType rType)
Definition refresh.cc:141
zyppng::repo::RefreshContext::_sigProbedTypeChanged
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
Definition refresh.h:130
zyppng::repo::RefreshContext::zyppContext
const ContextRef & zyppContext() const
Definition refresh.cc:93
zyppng::repo::RefreshContext::saveToRawCache
void saveToRawCache()
Definition refresh.cc:66
zyppng::repo::RefreshContext::PluginRepoverification
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition refresh.h:46
zyppng::repo::RefreshContext::probedType
const std::optional< zypp::repo::RepoType > & probedType() const
Definition refresh.cc:151
zyppng::repo::RefreshContext::~RefreshContext
~RefreshContext() override
Definition refresh.cc:60
zypp::RepoManagerFlags::RefreshCheckStatus
RefreshCheckStatus
Possibly return state of RepoManager::checkIfToRefreshMetadata function.
Definition RepoManagerFlags.h:47
zypp::RepoManagerFlags::RawMetadataRefreshPolicy
RawMetadataRefreshPolicy
Definition RepoManagerFlags.h:21
zyppng::repo
Definition downloader.cc:22
zyppng::repo::RefreshCheckStatus
zypp::RepoManagerFlags::RefreshCheckStatus RefreshCheckStatus
Definition refresh.h:34
zyppng::repo::RawMetadataRefreshPolicy
zypp::RepoManagerFlags::RawMetadataRefreshPolicy RawMetadataRefreshPolicy
Definition refresh.h:33
zyppng
Definition MediaNetworkRequestExecutor.h:16
repomanager.h
zypp::RepoManagerOptions
Repo manager settings.
Definition RepoManagerOptions.h:26
zypp::repo::RepoType
Repository type enumeration.
Definition RepoType.h:29
TmpPath.h
ZYPP_FWD_DECL_TYPE_WITH_REFS
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126