libzypp  17.3.0
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. More...
 
 ServiceInfo (const std::string &alias)
 Creates ServiceInfo with specified alias. More...
 
 ServiceInfo (const std::string &alias, const Url &url)
 ServiceInfo with alias and its URL. More...
 
virtual ~ServiceInfo ()
 
Url url () const
 The service url. More...
 
Url rawUrl () const
 The service raw url (no variables replaced) More...
 
void setUrl (const Url &url)
 Set the service url (raw value) More...
 
repo::ServiceType type () const
 Service type. More...
 
void setType (const repo::ServiceType &type)
 Set service type. More...
 
void setProbedType (const repo::ServiceType &t) const
 Lazy init service type. More...
 
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 Writes ServiceInfo to stream in ".service" format. More...
 
virtual std::ostream & dumpAsXmlOn (std::ostream &str, const std::string &content="") const
 Write an XML representation of this ServiceInfo object. More...
 
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. More...
 
void setTtl (Date::Duration ttl_r)
 Set sugested TTL. More...
 
void setProbedTtl (Date::Duration ttl_r) const
 Lazy init sugested TTL. More...
 
Date lrf () const
 Date of last refresh (if known). More...
 
void setLrf (Date lrf_r)
 Set date of last refresh. More...
 
- 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. More...
 
std::string escaped_alias () const
 Same as alias(), just escaped in a way to be a valid file name. More...
 
std::string name () const
 Repository name. More...
 
std::string rawName () const
 The raw metadata name (no default, no variables replaced). More...
 
std::string label () const
 Label for use in messages for the user interface. More...
 
std::string asUserString () const
 User string: label (alias or name) More...
 
bool enabled () const
 If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias. More...
 
bool autorefresh () const
 If true, the repostory must be refreshed before creating resolvables from it. More...
 
Pathname filepath () const
 File where this repo was read from. More...
 
void setAlias (const std::string &alias)
 set the repository alias More...
 
void setName (const std::string &name)
 set the repository name More...
 
void setEnabled (bool enabled)
 enable or disable the repository More...
 
void setAutorefresh (bool autorefresh)
 enable or disable autorefresh More...
 
void setFilepath (const Pathname &filename)
 set the path to the .repo file More...
 
virtual std::ostream & dumpOn (std::ostream &str) const
 Write a human-readable representation of this RepoInfoBase object into the str stream. More...
 

Static Public Attributes

static const ServiceInfo noService
 Represents an empty service. More...
 

Private Attributes

RWCOW_pointer< Impl_pimpl
 

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)
 

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. More...
 
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. More...
 
void addRepoToEnable (const std::string &alias_r)
 Add alias_r to the set of ReposToEnable. More...
 
void delRepoToEnable (const std::string &alias_r)
 Remove alias_r from the set of ReposToEnable. More...
 
void clearReposToEnable ()
 Clear the set of ReposToEnable. More...
 

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. More...
 
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. More...
 
void addRepoToDisable (const std::string &alias_r)
 Add alias_r to the set of ReposToDisable. More...
 
void delRepoToDisable (const std::string &alias_r)
 Remove alias_r from the set of ReposToDisable. More...
 
void clearReposToDisable ()
 Clear the set of ReposToDisable. More...
 

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
 
const RepoStatesrepoStates () const
 Access the remembered repository states. More...
 
void setRepoStates (RepoStates newStates_r)
 Remember a new set of repository states. More...
 

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

◆ 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

◆ ~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. 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()

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 211 of file ServiceInfo.h.


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