9#ifndef ZYPP_MEDIA_PROVIDE_H_INCLUDED
10#define ZYPP_MEDIA_PROVIDE_H_INCLUDED
12#include <zypp-core/ManagedFile.h>
13#include <zypp-core/zyppng/base/zyppglobal.h>
14#include <zypp-core/zyppng/base/Base>
15#include <zypp-core/zyppng/async/AsyncOp>
16#include <zypp-core/zyppng/pipelines/expected.h>
17#include <zypp-core/ByteCount.h>
18#include <zypp-media/ng/ProvideFwd>
19#include <zypp-media/ng/ProvideRes>
20#include <zypp-media/auth/AuthData>
21#include <boost/any.hpp>
26 struct CredManagerOptions;
41 using AnyMap = std::unordered_map<std::string, boost::any>;
51 std::shared_ptr<Provide>
parent()
const;
53 std::string
handle()
const;
56 std::shared_ptr<Data>
_ref;
91 virtual void pulse ( );
93 const Stats &
stats()
const;
116 AsyncOpRef<expected<ProvideRes>>
provide(
const std::vector<zypp::Url> &urls,
const ProvideFileSpec &request );
133 bool ejectDevice (
const std::string &queueRef,
const std::string &device );
157 SignalProxy<
MediaChangeAction(
const std::string &queueRef,
const std::string &label,
const int32_t mediaNr,
const std::vector<std::string> &devices,
const std::optional<std::string> &desc )>
sigMediaChangeRequested( );
163 SignalProxy< std::optional<zypp::media::AuthData> (
const zypp::Url &reqUrl,
const std::string &triedUsername,
const std::map<std::string, std::string> &extraValues ) >
sigAuthRequired();
Store and operate with byte count.
virtual void provideDone()
virtual void requestDone(ProvideItem &item, uint32_t reqId, const AnyMap &extraData={})
virtual void itemStart(ProvideItem &item)
virtual void provideStart()
const Stats & stats() const
virtual void requestStart(ProvideItem &item, uint32_t reqId, const zypp::Url &url, const AnyMap &extraData={})
virtual void requestFailed(ProvideItem &item, uint32_t reqId, const std::exception_ptr err, const AnyMap &requestData={})
virtual void itemFailed(ProvideItem &item)
virtual void requestRedirect(ProvideItem &item, uint32_t reqId, const zypp::Url &toUrl, const AnyMap &extraData={})
virtual void itemDone(ProvideItem &item)
AsyncOpRef< expected< ProvideRes > > provide(const std::vector< zypp::Url > &urls, const ProvideFileSpec &request)
const zypp::media::CredManagerOptions & credManangerOptions() const
SignalProxy< std::optional< zypp::media::AuthData >(const zypp::Url &reqUrl, const std::string &triedUsername, const std::map< std::string, std::string > &extraValues) > sigAuthRequired()
static ProvideRef create(const zypp::Pathname &workDir="")
AsyncOpRef< expected< MediaHandle > > attachMedia(const std::vector< zypp::Url > &urls, const ProvideMediaSpec &request)
friend class ProvideMediaHandle
void setWorkerPath(const zypp::Pathname &path)
SignalProxy< void()> sigIdle()
void setCredManagerOptions(const zypp::media::CredManagerOptions &opt)
void setStatusTracker(ProvideStatusRef tracker)
bool ejectDevice(const std::string &queueRef, const std::string &device)
ZYPP_DECLARE_PRIVATE(Provide)
AsyncOpRef< expected< std::string > > checksumForFile(const zypp::Pathname &p, const std::string &algorithm)
AsyncOpRef< expected< zypp::ManagedFile > > copyFile(const zypp::Pathname &source, const zypp::Pathname &target)
SignalProxy< MediaChangeAction(const std::string &queueRef, const std::string &label, const int32_t mediaNr, const std::vector< std::string > &devices, const std::optional< std::string > &desc)> sigMediaChangeRequested()
std::optional< Action > MediaChangeAction
const zypp::Pathname & providerWorkdir() const
void releaseMedia(const std::string &mediaRef)
Easy-to use interface to the ZYPP dependency resolver.
constexpr std::string_view Url("url")
std::unordered_map< std::string, boost::any > AnyMap
zypp::ByteCount _partialBytes
zypp::ByteCount _perSecondSinceLastPulse
zypp::ByteCount _perSecond
zypp::ByteCount _expectedBytes
std::chrono::steady_clock::time_point _startTime
zypp::ByteCount _finishedBytes
std::chrono::steady_clock::time_point _lastPulseTime