libzypp 17.37.17
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/zyppng/pipelines/AsyncResult>
13#include <zypp-core/zyppng/pipelines/Expected>
14#include <zypp-core/zyppng/base/Signals>
16
17#include <zypp/RepoInfo.h>
20#include <zypp/ng/repomanager.h>
23
24namespace zyppng {
27}
28
29namespace zyppng::repo {
30
32
35
42 template<typename ZyppContextRefType>
43 class RefreshContext : public Base, public MaybeAsyncMixin< std::is_same_v<ZyppContextRefType, ContextRef> > {
45 ZYPP_ENABLE_MAYBE_ASYNC_MIXIN( (std::is_same_v<ZyppContextRefType, ContextRef>) );
46 public:
47 using ContextRefType = ZyppContextRefType;
48 using ContextType = typename ZyppContextRefType::element_type;
49 using ProvideType = typename ContextType::ProvideType;
50 using MediaHandle = typename ProvideType::MediaHandle;
52
53 static expected<repo::RefreshContextRef<ZyppContextRefType>> create( ZyppContextRefType zyppContext, zypp::RepoInfo info, RepoManagerRef<ContextRefType> repoManager );
54 ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ZyppContextRefType &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef<ContextRefType> &&repoManager );
55
56 ~RefreshContext() override;
57
64
69
76
81 const ZyppContextRefType &zyppContext () const;
82
88 const zypp::RepoInfo &repoInfo () const;
90
94 const RepoManagerRef<ZyppContextRefType> &repoManager() const;
96
102
106 const std::optional<PluginRepoverification> &pluginRepoverification() const;
107
108 void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
109 { _pluginRepoverification = std::move(pluginRepoverification_r); }
110
116
122 const std::optional<zypp::repo::RepoType> &probedType() const;
124
125 private:
126 ZyppContextRefType _zyppContext;
127 RepoManagerRef<ContextRefType> _repoManager;
131 repo::RawMetadataRefreshPolicy _policy = RawMetadataRefreshPolicy::RefreshIfNeeded;
132 std::optional<PluginRepoverification> _pluginRepoverification;
133
134 std::optional<zypp::repo::RepoType> _probedType;
136
137 };
138
143
144}
145
146
147
148#endif
What is known about a repository.
Definition RepoInfo.h:72
Provide a new empty temporary directory and recursively delete it when no longer needed.
Definition TmpPath.h:188
Repository metadata verification beyond GPG.
ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ZyppContextRefType &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef< ContextRefType > &&repoManager)
typename ZyppContextRefType::element_type ContextType
Definition refresh.h:48
const zypp::RepoManagerOptions & repoManagerOptions() const
Definition refresh.cc:118
const RepoManagerRef< SyncContextRef > & repoManager() const
void setProbedType(zypp::repo::RepoType rType)
Definition refresh.cc:142
const std::optional< zypp::repo::RepoType > & probedType() const
Definition refresh.cc:152
zypp::Pathname targetDir() const
Definition refresh.cc:88
std::optional< PluginRepoverification > _pluginRepoverification
Definition refresh.h:132
std::optional< zypp::repo::RepoType > _probedType
Definition refresh.h:134
RawMetadataRefreshPolicy policy() const
Definition refresh.cc:124
ZYPP_ENABLE_MAYBE_ASYNC_MIXIN((std::is_same_v< ZyppContextRefType, ContextRef >))
typename ContextType::ProvideType ProvideType
Definition refresh.h:49
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition refresh.cc:136
static expected< repo::RefreshContextRef< ZyppContextRefType > > create(ZyppContextRefType zyppContext, zypp::RepoInfo info, RepoManagerRef< ContextRefType > repoManager)
Definition refresh.cc:32
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition refresh.h:108
void setPolicy(RawMetadataRefreshPolicy newPolicy)
Definition refresh.cc:130
const SyncContextRef & zyppContext() const
repo::RawMetadataRefreshPolicy _policy
Definition refresh.h:131
const zypp::RepoInfo & repoInfo() const
Definition refresh.cc:100
RepoManagerRef< ContextRefType > _repoManager
Definition refresh.h:127
const zypp::Pathname & rawCachePath() const
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition refresh.h:51
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
Definition refresh.h:135
zypp::RepoInfo & repoInfo()
Definition refresh.cc:106
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
Definition refresh.cc:158
typename ProvideType::MediaHandle MediaHandle
Definition refresh.h:50
ZyppContextRefType ContextRefType
Definition refresh.h:47
RefreshCheckStatus
Possibly return state of RepoManager::checkIfToRefreshMetadata function.
RefreshContext< ContextRef > AsyncRefreshContext
Definition refresh.h:140
RefreshContext< SyncContextRef > SyncRefreshContext
Definition refresh.h:139
zypp::RepoManagerFlags::RefreshCheckStatus RefreshCheckStatus
Definition refresh.h:34
zypp::RepoManagerFlags::RawMetadataRefreshPolicy RawMetadataRefreshPolicy
Definition refresh.h:33
Repo manager settings.
Repository type enumeration.
Definition RepoType.h:29
#define ZYPP_FWD_DECL_REFS(T)
Definition zyppglobal.h:119
#define ZYPP_FWD_DECL_TEMPL_TYPE_WITH_REFS_ARG1(T, TArg1)
Definition zyppglobal.h:130
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126