#include <SourceManager.h>
Inheritance diagram for zypp::SourceManager:
Iterate over all known SourceIds. | |
typedef MapKVIteratorTraits< SourceMap >::Key_const_iterator | SourceId_const_iterator |
SourceId_const_iterator | SourceId_begin () const |
SourceId_const_iterator | SourceId_end () const |
Iterate over all known Sources. | |
typedef MapKVIteratorTraits< SourceMap >::Value_const_iterator | Source_const_iterator |
Source_const_iterator | Source_begin () const |
Source_const_iterator | Source_end () const |
Iterate over all (SourceId,Source_Ref) pairs. | |
typedef SourceMap::const_iterator | const_iterator |
const_iterator | begin () const |
const_iterator | end () const |
Public Types | |
typedef Source_Ref::NumericId | SourceId |
Runtime unique numeric Source Id. | |
typedef std::list< SourceInfo > | SourceInfoList |
Public Member Functions | |
~SourceManager () | |
Dtor. | |
void | reset () |
Reset the manager - discard the sources database, do not store the changes to the persistent store. | |
SourceInfoList | knownSourceInfos (const Pathname &root_r) |
void | store (Pathname root_r, bool metadata_cache) |
Store the current state to the given path. | |
bool | restore (Pathname root_r, bool use_caches=true, const std::string &alias_filter="", const std::string &url_filter="") |
Source_Ref | findSource (SourceId id) |
Find a source with a specified ID. | |
Source_Ref | findSource (const std::string &alias_r) |
Find a source with a specified alias. | |
Source_Ref | findSourceByUrl (const Url &url_r) |
Find a source with a specified URL. | |
std::list< SourceId > | enabledSources () const |
Return the list of the currently enabled sources. | |
std::list< SourceId > | allSources () const |
Return ids of all sources. | |
SourceId | addSource (Source_Ref source_r) |
Add a new source. | |
void | removeSource (SourceId id) |
Remove an existing source by ID. | |
void | removeSource (const std::string &alias_r) |
Remove an existing source by Alias. | |
void | removeSourceByUrl (const Url &url_r) |
Remove an existing source by Url. | |
void | releaseAllSources () |
Release all medias held by all sources. | |
void | reattachSources (const Pathname &attach_point) |
Reattach all sources which are not mounted, but downloaded, to different directory. | |
void | disableAllSources () |
Disable all registered sources. | |
Static Public Member Functions | |
static SourceManager_Ptr | sourceManager () |
Singleton access. | |
static void | disableSourcesAt (const Pathname &root) |
Helper function to disable all sources in the persistent store on the given location. | |
Private Types | |
typedef std::map< SourceId, Source_Ref > | SourceMap |
exposition only | |
Private Member Functions | |
SourceManager () | |
Singleton ctor. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const SourceManager &obj) |
Classes | |
struct | SourceInfo |
List the known aliases and urls ( no need to restore first ). More... |
throwing findSource is not acceptable, return either a Source or noSource.
Make restore either void or nonthrowing, but two ways of error reporting is bad.
Definition at line 82 of file SourceManager.h.
|
Runtime unique numeric Source Id.
Definition at line 96 of file SourceManager.h. |
|
exposition only
Definition at line 100 of file SourceManager.h. |
|
Definition at line 104 of file SourceManager.h. |
|
Definition at line 114 of file SourceManager.h. |
|
Definition at line 124 of file SourceManager.h. |
|
Definition at line 147 of file SourceManager.h. |
|
Dtor.
Definition at line 137 of file SourceManager.cc. References MIL. |
|
Singleton ctor.
Definition at line 127 of file SourceManager.cc. References MIL. |
|
Singleton access.
Definition at line 45 of file SourceManager.cc. Referenced by zypp::source::SourceImpl::provideDirTree(), zypp::source::SourceImpl::provideJustFile(), and zypp::SourceCache::restoreSources(). |
|
Definition at line 142 of file SourceManager.cc. References zypp::_sources. |
|
Definition at line 145 of file SourceManager.cc. References zypp::_sources. |
|
Definition at line 148 of file SourceManager.cc. References zypp::_sources, and zypp::make_map_key_begin(). |
|
Definition at line 151 of file SourceManager.cc. References zypp::_sources, and zypp::make_map_key_end(). |
|
Definition at line 154 of file SourceManager.cc. References zypp::_sources, and zypp::make_map_value_begin(). |
|
Definition at line 157 of file SourceManager.cc. References zypp::_sources, and zypp::make_map_value_end(). |
|
Reset the manager - discard the sources database, do not store the changes to the persistent store.
Definition at line 160 of file SourceManager.cc. References zypp::_deleted_sources, zypp::_sources, and MIL. |
|
Definition at line 486 of file SourceManager.cc. |
|
Store the current state to the given path.
Definition at line 262 of file SourceManager.cc. References zypp::_deleted_sources, zypp::filesystem::assert_dir(), MIL, zypp::filesystem::recursive_rmdir(), and ZYPP_METADATA_PREFIX. Referenced by disableSourcesAt(), and knownSourceInfos(). |
|
If the sources database is not empty, it throws an exception
Definition at line 336 of file SourceManager.cc. References zypp::_sources, MIL, and ZYPP_THROW. |
|
Find a source with a specified ID.
Definition at line 515 of file SourceManager.cc. References zypp::_sources, and ZYPP_THROW. |
|
Find a source with a specified alias.
Definition at line 525 of file SourceManager.cc. References zypp::_sources. |
|
Find a source with a specified URL. URLs are unique in zenworks but NOT in zypp. A bug in SL 10.1 causes alias mismatches so we have to resort to URLs. #177543
Definition at line 539 of file SourceManager.cc. References zypp::_sources, and zypp::Url::asCompleteString(). |
|
Return the list of the currently enabled sources.
Definition at line 237 of file SourceManager.cc. References zypp::_sources. |
|
Return ids of all sources.
Definition at line 250 of file SourceManager.cc. References zypp::_sources. |
|
Add a new source. An attempt to add Source_Ref::noSource does nothing but returning Source_Ref::noSource.numericId(). Thus it results in adding no Source. Definition at line 167 of file SourceManager.cc. References zypp::sourceTableAdd(). |
|
Remove an existing source by ID.
Definition at line 172 of file SourceManager.cc. References zypp::_sources, zypp::sourceTableRemove(), and WAR. |
|
Remove an existing source by Alias.
Definition at line 180 of file SourceManager.cc. References zypp::_sources, zypp::sourceTableRemove(), and WAR. |
|
Remove an existing source by Url.
Definition at line 192 of file SourceManager.cc. References zypp::_sources, zypp::Url::asString(), zypp::sourceTableRemove(), and WAR. |
|
Release all medias held by all sources.
Definition at line 204 of file SourceManager.cc. References zypp::_sources, and MIL. |
|
Reattach all sources which are not mounted, but downloaded, to different directory.
Definition at line 215 of file SourceManager.cc. References zypp::_sources, and MIL. |
|
Disable all registered sources.
Definition at line 227 of file SourceManager.cc. References zypp::_sources, and MIL. |
|
Helper function to disable all sources in the persistent store on the given location. Does not manipulate with the current status of the source manager.
Definition at line 468 of file SourceManager.cc. |
|
Stream output Definition at line 510 of file SourceManager.cc. |