libzypp 17.31.23
zypp::ServiceInfo Class Reference

Service data. More...

#include <ServiceInfo.h>

Inheritance diagram for zypp::ServiceInfo:

Classes

struct  Impl
 
struct  RepoState
 

Public Member Functions

 ServiceInfo ()
 Default ctor creates noService.
 
 ServiceInfo (const std::string &alias)
 Creates ServiceInfo with specified alias.
 
 ServiceInfo (const std::string &alias, const Url &url)
 ServiceInfo with alias and its URL.
 
virtual ~ServiceInfo ()
 
Url url () const
 The service url.
 
Url rawUrl () const
 The service raw url (no variables replaced)
 
void setUrl (const Url &url)
 Set the service url (raw value)
 
repo::ServiceType type () const
 Service type.
 
void setType (const repo::ServiceType &type)
 Set service type.
 
void setProbedType (const repo::ServiceType &t) const
 Lazy init service type.
 
Housekeeping data

You don't want to use the setters unless you are a RepoManager.

Date::Duration ttl () const
 Sugested TTL between two metadata auto-refreshs.
 
void setTtl (Date::Duration ttl_r)
 Set sugested TTL.
 
void setProbedTtl (Date::Duration ttl_r) const
 Lazy init sugested TTL.
 
Date lrf () const
 Date of last refresh (if known).
 
void setLrf (Date lrf_r)
 Set date of last refresh.
 
- Public Member Functions inherited from zypp::repo::RepoInfoBase
 RepoInfoBase ()
 
 RepoInfoBase (const std::string &alias)
 
virtual ~RepoInfoBase ()
 
std::string alias () const
 unique identifier for this source.
 
std::string escaped_alias () const
 Same as alias(), just escaped in a way to be a valid file name.
 
std::string name () const
 Repository name.
 
std::string rawName () const
 The raw metadata name (no default, no variables replaced).
 
std::string label () const
 Label for use in messages for the user interface.
 
std::string asUserString () const
 User string: label (alias or name)
 
bool enabled () const
 If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.
 
bool autorefresh () const
 If true, the repostory must be refreshed before creating resolvables from it.
 
Pathname filepath () const
 File where this repo was read from.
 
void setAlias (const std::string &alias)
 set the repository alias
 
void setName (const std::string &name)
 set the repository name
 
void setEnabled (bool enabled)
 enable or disable the repository
 
void setAutorefresh (bool autorefresh)
 enable or disable autorefresh
 
void setFilepath (const Pathname &filename)
 set the path to the .repo file
 
virtual std::ostream & dumpOn (std::ostream &str) const
 Write a human-readable representation of this RepoInfoBase object into the str stream.
 
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 Write this RepoInfoBase object into str in a .repo (ini) file format.
 
virtual std::ostream & dumpAsXmlOn (std::ostream &str, const std::string &content="") const
 Write an XML representation of this object with content (if available).
 

Static Public Attributes

static const ServiceInfo noService
 Represents an empty service.
 

Related Functions

(Note that these are not member functions.)

typedef shared_ptr< ServiceInfoServiceInfo_Ptr
 
typedef shared_ptr< const ServiceInfoServiceInfo_constPtr
 
typedef std::list< ServiceInfoServiceInfoList
 
std::ostream & operator<< (std::ostream &str, const ServiceInfo &obj)
 Stream output.
 

Set of repos (repository aliases) to enable on next refresh.

Per default new repositories are created in disabled state.

But repositories mentioned here will be created in enabled state on the next refresh. Afterwards they get removed from the list.

typedef std::set< std::string > ReposToEnable
 Container of repos.
 
bool reposToEnableEmpty () const
 
ReposToEnable::size_type reposToEnableSize () const
 
ReposToEnable::const_iterator reposToEnableBegin () const
 
ReposToEnable::const_iterator reposToEnableEnd () const
 
Iterable< ReposToEnable::const_iterator > reposToEnable () const
 
bool repoToEnableFind (const std::string &alias_r) const
 Whether alias_r is mentioned in ReposToEnable.
 
void addRepoToEnable (const std::string &alias_r)
 Add alias_r to the set of ReposToEnable.
 
void delRepoToEnable (const std::string &alias_r)
 Remove alias_r from the set of ReposToEnable.
 
void clearReposToEnable ()
 Clear the set of ReposToEnable.
 

Set of repos (repository aliases) to disable on next refresh.

Repositories mentioned here will be disabled on the next refresh, in case they still exist.

Afterwards they get removed from the list.

typedef std::set< std::string > ReposToDisable
 Container of repos.
 
bool reposToDisableEmpty () const
 
ReposToDisable::size_type reposToDisableSize () const
 
ReposToDisable::const_iterator reposToDisableBegin () const
 
ReposToDisable::const_iterator reposToDisableEnd () const
 
Iterable< ReposToDisable::const_iterator > reposToDisable () const
 
bool repoToDisableFind (const std::string &alias_r) const
 Whether alias_r is mentioned in ReposToDisable.
 
void addRepoToDisable (const std::string &alias_r)
 Add alias_r to the set of ReposToDisable.
 
void delRepoToDisable (const std::string &alias_r)
 Remove alias_r from the set of ReposToDisable.
 
void clearReposToDisable ()
 Clear the set of ReposToDisable.
 

The original repo state as defined by the repoindex.xml upon last refresh.

This state is remembered to detect any user modifications applied to the repos.

It may not be available for all repos or in plugin services. In this case all changes requested by a service refresh are applied unconditionally.

typedef std::map< std::string, RepoStateRepoStates
 
RWCOW_pointer< Impl_pimpl
 
const RepoStatesrepoStates () const
 Access the remembered repository states.
 
void setRepoStates (RepoStates newStates_r)
 Remember a new set of repository states.
 
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 Writes ServiceInfo to stream in ".service" format.
 
virtual std::ostream & dumpAsXmlOn (std::ostream &str, const std::string &content="") const
 Write an XML representation of this ServiceInfo object.
 

Detailed Description

Service data.

Note
Name and Url are subject to repo variable replacement (
See also
RepoVariablesStringReplacer).

Definition at line 36 of file ServiceInfo.h.

Member Typedef Documentation

◆ ReposToEnable

typedef std::set<std::string> zypp::ServiceInfo::ReposToEnable

Container of repos.

Definition at line 115 of file ServiceInfo.h.

◆ ReposToDisable

typedef std::set<std::string> zypp::ServiceInfo::ReposToDisable

Container of repos.

Definition at line 141 of file ServiceInfo.h.

◆ RepoStates

typedef std::map<std::string,RepoState> zypp::ServiceInfo::RepoStates

Definition at line 185 of file ServiceInfo.h.

Constructor & Destructor Documentation

◆ ServiceInfo() [1/3]

zypp::ServiceInfo::ServiceInfo ( )

Default ctor creates noService.

Definition at line 86 of file ServiceInfo.cc.

◆ ServiceInfo() [2/3]

zypp::ServiceInfo::ServiceInfo ( const std::string &  alias)

Creates ServiceInfo with specified alias.

Parameters
aliasunique short name of service

Definition at line 88 of file ServiceInfo.cc.

◆ ServiceInfo() [3/3]

zypp::ServiceInfo::ServiceInfo ( const std::string &  alias,
const Url url 
)

ServiceInfo with alias and its URL.

Parameters
aliasunique shortname of service
urlurl to service

Definition at line 92 of file ServiceInfo.cc.

◆ ~ServiceInfo()

zypp::ServiceInfo::~ServiceInfo ( )
virtual

Definition at line 96 of file ServiceInfo.cc.

Member Function Documentation

◆ url()

Url zypp::ServiceInfo::url ( ) const

The service url.

Definition at line 99 of file ServiceInfo.cc.

◆ rawUrl()

Url zypp::ServiceInfo::rawUrl ( ) const

The service raw url (no variables replaced)

Definition at line 102 of file ServiceInfo.cc.

◆ setUrl()

void zypp::ServiceInfo::setUrl ( const Url url)

Set the service url (raw value)

Definition at line 105 of file ServiceInfo.cc.

◆ type()

repo::ServiceType zypp::ServiceInfo::type ( ) const

Service type.

Definition at line 108 of file ServiceInfo.cc.

◆ setType()

void zypp::ServiceInfo::setType ( const repo::ServiceType type)

Set service type.

Definition at line 109 of file ServiceInfo.cc.

◆ setProbedType()

void zypp::ServiceInfo::setProbedType ( const repo::ServiceType t) const

Lazy init service type.

Definition at line 110 of file ServiceInfo.cc.

◆ ttl()

Date::Duration zypp::ServiceInfo::ttl ( ) const

Sugested TTL between two metadata auto-refreshs.

The value (in seconds) may be provided in repoindex.xml:xpath:/repoindex@ttl. Default is 0 - perform each auto-refresh request.

Definition at line 112 of file ServiceInfo.cc.

◆ setTtl()

void zypp::ServiceInfo::setTtl ( Date::Duration  ttl_r)

Set sugested TTL.

Definition at line 113 of file ServiceInfo.cc.

◆ setProbedTtl()

void zypp::ServiceInfo::setProbedTtl ( Date::Duration  ttl_r) const

Lazy init sugested TTL.

Definition at line 114 of file ServiceInfo.cc.

◆ lrf()

Date zypp::ServiceInfo::lrf ( ) const

Date of last refresh (if known).

Definition at line 116 of file ServiceInfo.cc.

◆ setLrf()

void zypp::ServiceInfo::setLrf ( Date  lrf_r)

Set date of last refresh.

Definition at line 117 of file ServiceInfo.cc.

◆ reposToEnableEmpty()

bool zypp::ServiceInfo::reposToEnableEmpty ( ) const

Definition at line 119 of file ServiceInfo.cc.

◆ reposToEnableSize()

ServiceInfo::ReposToEnable::size_type zypp::ServiceInfo::reposToEnableSize ( ) const

Definition at line 120 of file ServiceInfo.cc.

◆ reposToEnableBegin()

ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableBegin ( ) const

Definition at line 121 of file ServiceInfo.cc.

◆ reposToEnableEnd()

ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableEnd ( ) const

Definition at line 122 of file ServiceInfo.cc.

◆ reposToEnable()

Iterable< ReposToEnable::const_iterator > zypp::ServiceInfo::reposToEnable ( ) const
inline

Definition at line 120 of file ServiceInfo.h.

◆ repoToEnableFind()

bool zypp::ServiceInfo::repoToEnableFind ( const std::string &  alias_r) const

Whether alias_r is mentioned in ReposToEnable.

Definition at line 124 of file ServiceInfo.cc.

◆ addRepoToEnable()

void zypp::ServiceInfo::addRepoToEnable ( const std::string &  alias_r)

Add alias_r to the set of ReposToEnable.

Definition at line 127 of file ServiceInfo.cc.

◆ delRepoToEnable()

void zypp::ServiceInfo::delRepoToEnable ( const std::string &  alias_r)

Remove alias_r from the set of ReposToEnable.

Definition at line 133 of file ServiceInfo.cc.

◆ clearReposToEnable()

void zypp::ServiceInfo::clearReposToEnable ( )

Clear the set of ReposToEnable.

Definition at line 136 of file ServiceInfo.cc.

◆ reposToDisableEmpty()

bool zypp::ServiceInfo::reposToDisableEmpty ( ) const

Definition at line 140 of file ServiceInfo.cc.

◆ reposToDisableSize()

ServiceInfo::ReposToDisable::size_type zypp::ServiceInfo::reposToDisableSize ( ) const

Definition at line 141 of file ServiceInfo.cc.

◆ reposToDisableBegin()

ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableBegin ( ) const

Definition at line 142 of file ServiceInfo.cc.

◆ reposToDisableEnd()

ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableEnd ( ) const

Definition at line 143 of file ServiceInfo.cc.

◆ reposToDisable()

Iterable< ReposToDisable::const_iterator > zypp::ServiceInfo::reposToDisable ( ) const
inline

Definition at line 146 of file ServiceInfo.h.

◆ repoToDisableFind()

bool zypp::ServiceInfo::repoToDisableFind ( const std::string &  alias_r) const

Whether alias_r is mentioned in ReposToDisable.

Definition at line 145 of file ServiceInfo.cc.

◆ addRepoToDisable()

void zypp::ServiceInfo::addRepoToDisable ( const std::string &  alias_r)

Add alias_r to the set of ReposToDisable.

Definition at line 148 of file ServiceInfo.cc.

◆ delRepoToDisable()

void zypp::ServiceInfo::delRepoToDisable ( const std::string &  alias_r)

Remove alias_r from the set of ReposToDisable.

Definition at line 154 of file ServiceInfo.cc.

◆ clearReposToDisable()

void zypp::ServiceInfo::clearReposToDisable ( )

Clear the set of ReposToDisable.

Definition at line 157 of file ServiceInfo.cc.

◆ repoStates()

const ServiceInfo::RepoStates & zypp::ServiceInfo::repoStates ( ) const

Access the remembered repository states.

Definition at line 161 of file ServiceInfo.cc.

◆ setRepoStates()

void zypp::ServiceInfo::setRepoStates ( RepoStates  newStates_r)

Remember a new set of repository states.

Definition at line 162 of file ServiceInfo.cc.

◆ dumpAsIniOn()

std::ostream & zypp::ServiceInfo::dumpAsIniOn ( std::ostream &  str) const
virtual

Writes ServiceInfo to stream in ".service" format.

Parameters
strstream where serialized version service is written

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 173 of file ServiceInfo.cc.

◆ dumpAsXmlOn()

std::ostream & zypp::ServiceInfo::dumpAsXmlOn ( std::ostream &  str,
const std::string &  content = "" 
) const
virtual

Write an XML representation of this ServiceInfo object.

Parameters
str
contentif not empty, produces <service ...>content</service> otherwise <service .../>

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 210 of file ServiceInfo.cc.

Friends And Related Function Documentation

◆ ServiceInfo_Ptr

Definition at line 219 of file ServiceInfo.h.

◆ ServiceInfo_constPtr

Definition at line 221 of file ServiceInfo.h.

◆ ServiceInfoList

typedef std::list<ServiceInfo> ServiceInfoList
related

Definition at line 223 of file ServiceInfo.h.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const ServiceInfo obj 
)
related

Stream output.

Definition at line 231 of file ServiceInfo.cc.

Member Data Documentation

◆ noService

const ServiceInfo zypp::ServiceInfo::noService
static

Represents an empty service.

Definition at line 61 of file ServiceInfo.h.

◆ _pimpl

RWCOW_pointer<Impl> zypp::ServiceInfo::_pimpl
private

Definition at line 214 of file ServiceInfo.h.


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