libzypp  13.10.6
zypp::repo::PackageProvider::Impl Class Referenceabstract

PackageProvider implementation. More...

Inheritance diagram for zypp::repo::PackageProvider::Impl:
zypp::repo::RpmPackageProvider

Public Member Functions

 Impl (RepoMediaAccess &access_r, const Package::constPtr &package_r, const DeltaCandidates &deltas_r, const PackageProviderPolicy &policy_r)
 Ctor taking the Package to provide. More...
 
virtual ~Impl ()
 
ManagedFile providePackage () const
 Provide the package. More...
 
ManagedFile providePackageFromCache () const
 Provide the package if it is cached. More...
 
bool isCached () const
 Whether the package is cached. More...
 

Static Public Member Functions

static ImplfactoryMake (RepoMediaAccess &access_r, const Package::constPtr &package_r, const DeltaCandidates &deltas_r, const PackageProviderPolicy &policy_r)
 Factory method providing the appropriate implementation. More...
 

Protected Types

typedef PackageProvider::Impl Base
 
typedef callback::SendReport
< repo::DownloadResolvableReport
Report
 

Protected Member Functions

virtual ManagedFile doProvidePackageFromCache () const =0
 Lookup the final rpm in cache. More...
 
virtual ManagedFile doProvidePackage () const =0
 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...
 
bool failOnChecksumError () const
 Redirect ProvideFilePolicy failOnChecksumError to this if needed. More...
 

Protected Attributes

PackageProviderPolicy _policy
 
Package::constPtr _package
 
DeltaCandidates _deltas
 
RepoMediaAccess_access
 

Private Types

typedef shared_ptr< void > ScopedGuard
 

Private Member Functions

ScopedGuard newReport () const
 

Private Attributes

bool _retry
 
shared_ptr< Report_report
 

Detailed Description

PackageProvider implementation.

Definition at line 53 of file PackageProvider.cc.

Member Typedef Documentation

Definition at line 173 of file PackageProvider.cc.

Constructor & Destructor Documentation

zypp::repo::PackageProvider::Impl::Impl ( RepoMediaAccess access_r,
const Package::constPtr package_r,
const DeltaCandidates deltas_r,
const PackageProviderPolicy policy_r 
)
inline

Ctor taking the Package to provide.

Definition at line 57 of file PackageProvider.cc.

virtual zypp::repo::PackageProvider::Impl::~Impl ( )
inlinevirtual

Definition at line 68 of file PackageProvider.cc.

Member Function Documentation

PackageProvider::Impl * zypp::repo::PackageProvider::Impl::factoryMake ( RepoMediaAccess access_r,
const Package::constPtr package_r,
const DeltaCandidates deltas_r,
const PackageProviderPolicy policy_r 
)
static

Factory method providing the appropriate implementation.

Called by PackageProvider ctor. Returned pointer should be immediately wrapped into a smartpointer.

Definition at line 439 of file PackageProvider.cc.

ManagedFile zypp::repo::PackageProvider::Impl::providePackage ( ) const

Provide the package.

The basic workflow.

Exceptions
Exception.

Definition at line 209 of file PackageProvider.cc.

ManagedFile zypp::repo::PackageProvider::Impl::providePackageFromCache ( ) const
inline

Provide the package if it is cached.

Definition at line 87 of file PackageProvider.cc.

bool zypp::repo::PackageProvider::Impl::isCached ( ) const
inline

Whether the package is cached.

Definition at line 96 of file PackageProvider.cc.

ManagedFile zypp::repo::PackageProvider::Impl::doProvidePackageFromCache ( ) const
protectedpure virtual

Lookup the final rpm in cache.

Default implementation (cache miss).

A non empty ManagedFile will be returned to the caller.

Note
File disposal depending on the repos keepPackages setting are not set here, but in providePackage or providePackageFromCache.
The provoided default implementation returns an empty ManagedFile (cache miss).

Implemented in zypp::repo::RpmPackageProvider.

Definition at line 192 of file PackageProvider.cc.

ManagedFile zypp::repo::PackageProvider::Impl::doProvidePackage ( ) const
protectedpure virtual

Actually provide the final rpm.

Default implementation (provide full package)

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

Proxy methods for progressPackageDownload and failOnChecksum are provided here. Create similar proxies for other progress callbacks in derived classes and link it to ProvideFilePolicy for download:

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

Implemented in zypp::repo::RpmPackageProvider.

Definition at line 196 of file PackageProvider.cc.

Report& zypp::repo::PackageProvider::Impl::report ( ) const
inlineprotected

Access to the DownloadResolvableReport.

Definition at line 136 of file PackageProvider.cc.

bool zypp::repo::PackageProvider::Impl::progressPackageDownload ( int  value) const
inlineprotected

Redirect ProvideFilePolicy package download progress to this.

Definition at line 140 of file PackageProvider.cc.

bool zypp::repo::PackageProvider::Impl::failOnChecksumError ( ) const
inlineprotected

Redirect ProvideFilePolicy failOnChecksumError to this if needed.

Definition at line 144 of file PackageProvider.cc.

ScopedGuard zypp::repo::PackageProvider::Impl::newReport ( ) const
inlineprivate

Definition at line 175 of file PackageProvider.cc.

Member Data Documentation

PackageProviderPolicy zypp::repo::PackageProvider::Impl::_policy
protected

Definition at line 167 of file PackageProvider.cc.

Package::constPtr zypp::repo::PackageProvider::Impl::_package
protected

Definition at line 168 of file PackageProvider.cc.

DeltaCandidates zypp::repo::PackageProvider::Impl::_deltas
protected

Definition at line 169 of file PackageProvider.cc.

RepoMediaAccess& zypp::repo::PackageProvider::Impl::_access
protected

Definition at line 170 of file PackageProvider.cc.

bool zypp::repo::PackageProvider::Impl::_retry
mutableprivate

Definition at line 186 of file PackageProvider.cc.

shared_ptr<Report> zypp::repo::PackageProvider::Impl::_report
mutableprivate

Definition at line 187 of file PackageProvider.cc.


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