libzypp  16.13.0
zypp::repo::PackageProviderImpl< TPackage > Class Template Reference
Inheritance diagram for zypp::repo::PackageProviderImpl< TPackage >:

Public Member Functions

 PackageProviderImpl (RepoMediaAccess &access_r, const TPackagePtr &package_r, const PackageProviderPolicy &policy_r)
 Ctor taking the Package to provide. More...
 
virtual ~PackageProviderImpl ()
 
virtual ManagedFile providePackage () const
 Provide the package. More...
 
virtual ManagedFile providePackageFromCache () const
 Provide the package if it is cached. More...
 
virtual bool isCached () const
 Whether the package is cached. More...
 
- Public Member Functions inherited from zypp::repo::PackageProvider::Impl
 Impl ()
 
virtual ~Impl ()
 

Protected Types

typedef PackageProviderImpl< TPackage > Base
 
typedef callback::SendReport< repo::DownloadResolvableReportReport
 
typedef target::rpm::RpmDb RpmDb
 

Protected Member Functions

ManagedFile doProvidePackageFromCache () const
 Lookup the final rpm in cache. More...
 
virtual ManagedFile doProvidePackage () const
 Actually provide the final rpm. More...
 
Reportreport () const
 Access to the DownloadResolvableReport. More...
 
bool progressPackageDownload (int value) const
 Redirect ProvideFilePolicy package download progress to this. More...
 
RpmDb::CheckPackageResult packageSigCheck (const Pathname &path_r, UserData &userData) const
 
void resolveSignatureErrorAction (repo::DownloadResolvableReport::Action action_r) const
 React on signature verification error user action. More...
 
void defaultReportSignatureError (RpmDb::CheckPackageResult ret, const std::string &detail_r=std::string()) const
 Default signature verification error handling. More...
 

Protected Attributes

PackageProviderPolicy _policy
 
TPackagePtr _package
 
RepoMediaAccess_access
 

Private Types

typedef TPackage::constPtr TPackagePtr
 
typedef callback::UserData UserData
 
typedef shared_ptr< void > ScopedGuard
 

Private Member Functions

ScopedGuard newReport () const
 

Private Attributes

bool _retry
 
shared_ptr< Report_report
 
Target_Ptr _target
 

Detailed Description

template<class TPackage>
class zypp::repo::PackageProviderImpl< TPackage >

Definition at line 92 of file PackageProvider.cc.

Member Typedef Documentation

template<class TPackage>
typedef TPackage::constPtr zypp::repo::PackageProviderImpl< TPackage >::TPackagePtr
private

Definition at line 94 of file PackageProvider.cc.

template<class TPackage>
typedef callback::UserData zypp::repo::PackageProviderImpl< TPackage >::UserData
private

Definition at line 95 of file PackageProvider.cc.

template<class TPackage>
typedef PackageProviderImpl<TPackage> zypp::repo::PackageProviderImpl< TPackage >::Base
protected

Definition at line 129 of file PackageProvider.cc.

template<class TPackage>
typedef callback::SendReport<repo::DownloadResolvableReport> zypp::repo::PackageProviderImpl< TPackage >::Report
protected

Definition at line 130 of file PackageProvider.cc.

template<class TPackage>
typedef target::rpm::RpmDb zypp::repo::PackageProviderImpl< TPackage >::RpmDb
protected

Definition at line 175 of file PackageProvider.cc.

template<class TPackage>
typedef shared_ptr<void> zypp::repo::PackageProviderImpl< TPackage >::ScopedGuard
private

Definition at line 230 of file PackageProvider.cc.

Constructor & Destructor Documentation

template<class TPackage>
zypp::repo::PackageProviderImpl< TPackage >::PackageProviderImpl ( RepoMediaAccess access_r,
const TPackagePtr package_r,
const PackageProviderPolicy policy_r 
)
inline

Ctor taking the Package to provide.

Definition at line 98 of file PackageProvider.cc.

template<class TPackage>
virtual zypp::repo::PackageProviderImpl< TPackage >::~PackageProviderImpl ( )
inlinevirtual

Definition at line 106 of file PackageProvider.cc.

Member Function Documentation

template<class TPackage >
ManagedFile zypp::repo::PackageProviderImpl< TPackage >::providePackage ( ) const
virtual

Provide the package.

The basic workflow.

Exceptions
Exception.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 250 of file PackageProvider.cc.

template<class TPackage>
virtual ManagedFile zypp::repo::PackageProviderImpl< TPackage >::providePackageFromCache ( ) const
inlinevirtual

Provide the package if it is cached.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 116 of file PackageProvider.cc.

template<class TPackage>
virtual bool zypp::repo::PackageProviderImpl< TPackage >::isCached ( ) const
inlinevirtual

Whether the package is cached.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 125 of file PackageProvider.cc.

template<class TPackage>
ManagedFile zypp::repo::PackageProviderImpl< TPackage >::doProvidePackageFromCache ( ) const
inlineprotected

Lookup the final rpm in cache.

A cache hit will return a non empty ManagedFile and an empty one on cache miss.

Note
File disposal depending on the repos keepPackages setting are not set here, but in providePackage or providePackageFromCache.

Definition at line 139 of file PackageProvider.cc.

template<class TPackage>
virtual ManagedFile zypp::repo::PackageProviderImpl< TPackage >::doProvidePackage ( ) const
inlineprotectedvirtual

Actually provide the final rpm.

Report start/problem/finish and retry loop are hadled by providePackage. Here you trigger just progress and delta/plugin callbacks as needed.

Proxy method for progressPackageDownload is provided here.

ProvideFilePolicy policy;
policy.progressCB( bind( &Base::progressPackageDownload, this, _1 ) );
return _access.provideFile( _package->repoInfo(), loc, policy );
Note
The provided default implementation retrieves the packages default location.

Reimplemented in zypp::repo::RpmPackageProvider.

Definition at line 156 of file PackageProvider.cc.

template<class TPackage>
Report& zypp::repo::PackageProviderImpl< TPackage >::report ( ) const
inlineprotected

Access to the DownloadResolvableReport.

Definition at line 168 of file PackageProvider.cc.

template<class TPackage>
bool zypp::repo::PackageProviderImpl< TPackage >::progressPackageDownload ( int  value) const
inlineprotected

Redirect ProvideFilePolicy package download progress to this.

Definition at line 172 of file PackageProvider.cc.

template<class TPackage>
RpmDb::CheckPackageResult zypp::repo::PackageProviderImpl< TPackage >::packageSigCheck ( const Pathname &  path_r,
UserData userData 
) const
inlineprotected

Definition at line 177 of file PackageProvider.cc.

template<class TPackage>
void zypp::repo::PackageProviderImpl< TPackage >::resolveSignatureErrorAction ( repo::DownloadResolvableReport::Action  action_r) const
inlineprotected

React on signature verification error user action.

Note
: IGNORE == accept insecure file (no SkipRequestException!)

Definition at line 197 of file PackageProvider.cc.

template<class TPackage>
void zypp::repo::PackageProviderImpl< TPackage >::defaultReportSignatureError ( RpmDb::CheckPackageResult  ret,
const std::string &  detail_r = std::string() 
) const
inlineprotected

Default signature verification error handling.

Definition at line 215 of file PackageProvider.cc.

template<class TPackage>
ScopedGuard zypp::repo::PackageProviderImpl< TPackage >::newReport ( ) const
inlineprivate

Definition at line 232 of file PackageProvider.cc.

Member Data Documentation

template<class TPackage>
PackageProviderPolicy zypp::repo::PackageProviderImpl< TPackage >::_policy
protected

Definition at line 225 of file PackageProvider.cc.

template<class TPackage>
TPackagePtr zypp::repo::PackageProviderImpl< TPackage >::_package
protected

Definition at line 226 of file PackageProvider.cc.

template<class TPackage>
RepoMediaAccess& zypp::repo::PackageProviderImpl< TPackage >::_access
protected

Definition at line 227 of file PackageProvider.cc.

template<class TPackage>
bool zypp::repo::PackageProviderImpl< TPackage >::_retry
mutableprivate

Definition at line 243 of file PackageProvider.cc.

template<class TPackage>
shared_ptr<Report> zypp::repo::PackageProviderImpl< TPackage >::_report
mutableprivate

Definition at line 244 of file PackageProvider.cc.

template<class TPackage>
Target_Ptr zypp::repo::PackageProviderImpl< TPackage >::_target
mutableprivate

Definition at line 245 of file PackageProvider.cc.


The documentation for this class was generated from the following file: