14#ifndef ZYPP_MEDIA_PRIVATE_PROVIDE_P_H_INCLUDED
15#define ZYPP_MEDIA_PRIVATE_PROVIDE_P_H_INCLUDED
21#include <zypp-media/auth/CredentialManager>
22#include <zypp-media/ng/Provide>
23#include <zypp-media/ng/ProvideItem>
24#include <zypp-media/ng/ProvideSpec>
26#include <zypp-core/zyppng/base/Timer>
60 bool dequeueRequest( ProvideRequestRef req, std::exception_ptr error );
65 AttachedMediaInfo_Ptr
addMedium ( AttachedMediaInfo_Ptr &&medium );
84 std::list<ProvideItemRef> &
items();
90 ProvideStatusRef
log () {
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
std::unordered_map< std::string, ProvideQueue::Config > _schemeConfigs
const std::string queueName(ProvideQueue &q) const
void onItemStateChanged(ProvideItem &item)
std::string effectiveScheme(const std::string &scheme) const
std::list< ProvideItemRef > _items
std::optional< zypp::ManagedFile > addToFileCache(const zypp::Pathname &downloadedFile)
bool dequeueRequest(ProvideRequestRef req, std::exception_ptr error)
zypp::media::CredManagerOptions _credManagerOptions
ProvidePrivate(zypp::Pathname &&workDir, Provide &pub)
std::string nextMediaId() const
Signal< std::optional< zypp::media::AuthData >(const zypp::Url &reqUrl, const std::string &triedUsername, const std::map< std::string, std::string > &extraValues) > _sigAuthRequired
void queueItem(ProvideItemRef item)
zypp::media::CredManagerOptions & credManagerOptions()
Timer::Ptr _scheduleTrigger
zypp::Pathname _workerPath
bool queueRequest(ProvideRequestRef req)
std::unordered_map< std::string, ProvideQueueRef > _workerQueues
std::vector< AttachedMediaInfo_Ptr > _attachedMediaInfos
std::unordered_map< std::string, FileCacheItem > _fileCache
zypp::MirroredOrigin sanitizeUrls(const zypp::MirroredOrigin &origin)
void onPulseTimeout(Timer &)
bool isInCache(const zypp::Pathname &downloadedFile) const
std::vector< AttachedMediaInfo_Ptr > & attachedMediaInfos()
std::deque< QueueItem > _queues
Signal< Provide::MediaChangeAction(const std::string &, const std::string &, const int32_t, const std::vector< std::string > &, const std::optional< std::string > &) > _sigMediaChange
void schedule(ScheduleReason reason)
AttachedMediaInfo_Ptr addMedium(AttachedMediaInfo_Ptr &&medium)
std::unordered_map< std::string, std::string > _workerAlias
void dequeueItem(ProvideItem *item)
expected< ProvideQueue::Config > schemeConfig(const std::string &scheme)
const zypp::Pathname & workerPath() const
std::list< ProvideItemRef > & items()
std::optional< Action > MediaChangeAction
The Timer class provides repetitive and single-shot timers.
static std::shared_ptr< Timer > create()
Creates a new Timer object, the timer is not started at this point.
std::shared_ptr< Timer > Ptr
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
constexpr auto DEFAULT_CPU_WORKERS
constexpr auto DEFAULT_ACTIVE_CONN_PER_HOST
constexpr std::string_view DEFAULT_PROVIDE_WORKER_PATH
constexpr auto DEFAULT_ACTIVE_CONN
constexpr auto DEFAULT_MAX_DYNAMIC_WORKERS
constexpr std::string_view ATTACHED_MEDIA_SUFFIX
std::optional< std::chrono::steady_clock::time_point > _deathTimer
std::deque< ProvideRequestRef > _requests
#define ZYPP_DECLARE_PUBLIC(Class)