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>
25#include <zypp-proto/core/envelope.pb.h>
26#include <zypp-proto/media/provider.pb.h>
27#include <zypp-core/zyppng/base/private/base_p.h>
28#include <zypp-core/zyppng/base/Timer>
29#include <zypp-core/ManagedFile.h>
46 class RpcMessageStream;
69 bool dequeueRequest( ProvideRequestRef req, std::exception_ptr error );
82 expected<ProvideQueue::Config>
schemeConfig(
const std::string &scheme);
94 std::list<ProvideItemRef> &
items();
98 ProvideStatusRef
log () {
105 Signal< std::optional<zypp::media::AuthData> (
const zypp::Url &reqUrl,
const std::string &triedUsername,
const std::map<std::string, std::string> &extraValues ) >
_sigAuthRequired;
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::vector< AttachedMediaInfo > _attachedMediaInfos
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
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
ZYPP_DECLARE_PUBLIC(Provide)
std::unordered_map< std::string, FileCacheItem > _fileCache
void onPulseTimeout(Timer &)
bool isInCache(const zypp::Pathname &downloadedFile) const
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
std::vector< AttachedMediaInfo > & attachedMediaInfos()
void schedule(ScheduleReason reason)
std::unordered_map< std::string, std::string > _workerAlias
AttachedMediaInfo & addMedium(zypp::proto::Capabilities::WorkerType workerType, const zypp::Url &baseUrl, ProvideMediaSpec &spec)
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
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::shared_ptr< RpcMessageStream > RpcMessageStreamPtr
std::optional< std::chrono::steady_clock::time_point > _deathTimer
std::deque< ProvideRequestRef > _requests