libzypp  17.23.5
TransferSettings.h
Go to the documentation of this file.
1 
2 #ifndef TRANSFER_SETTINGS_H_
3 #define TRANSFER_SETTINGS_H_
4 
5 #include <string>
6 #include <vector>
7 #include <zypp/base/Flags.h>
8 #include <zypp/base/PtrTypes.h>
9 #include <zypp/Pathname.h>
10 #include <zypp/Url.h>
11 
12 namespace zypp
13 {
14  namespace media
15  {
16 
21  {
22  public:
25 
26  typedef std::vector<std::string> Headers;
27 
29  void reset();
30 
31 
33  void addHeader( std::string && val_r );
34 
36  Headers::const_iterator headersBegin() const;
37 
39  Headers::const_iterator headersEnd() const;
40 
41 
43  void setUserAgentString( std::string && val_r );
44 
46  std::string userAgentString() const;
47 
48 
50  void setUsername( std::string && val_r );
51 
53  std::string username() const;
54 
56  void setPassword( std::string && val_r );
57 
59  std::string password() const;
60 
62  std::string userPassword() const;
63 
65  void setAnonymousAuth();
66 
67 
69  void setProxyEnabled( bool enabled );
70 
72  bool proxyEnabled() const;
73 
74 
76  void setProxy( std::string && val_r );
77 
79  std::string proxy() const;
80 
81 
83  void setProxyUsername( std::string && val_r );
84 
86  std::string proxyUsername() const;
87 
89  void setProxyPassword( std::string && val_r );
90 
92  std::string proxyPassword() const;
93 
95  std::string proxyUserPassword() const;
96 
97 
99  void setConnectTimeout( long t );
100 
102  long connectTimeout() const;
103 
104 
106  void setTimeout( long t );
107 
109  long timeout() const;
110 
111 
113  void setMaxConcurrentConnections(long v);
114 
116  long maxConcurrentConnections() const;
117 
118 
120  void setMinDownloadSpeed(long v);
121 
123  long minDownloadSpeed() const;
124 
125 
127  void setMaxDownloadSpeed(long v);
128 
130  long maxDownloadSpeed() const;
131 
132 
134  void setMaxSilentTries(long v);
135 
137  long maxSilentTries() const;
138 
139 
141  void setVerifyHostEnabled( bool enabled );
142 
144  bool verifyHostEnabled() const;
145 
146 
148  void setVerifyPeerEnabled( bool enabled );
149 
151  bool verifyPeerEnabled() const;
152 
153 
155  void setCertificateAuthoritiesPath( Pathname && val_r );
156 
159 
160 
162  void setAuthType( std::string && val_r );
163 
165  std::string authType() const;
166 
167 
169  void setHeadRequestsAllowed(bool allowed);
170 
172  bool headRequestsAllowed() const;
173 
174 
176  void setClientCertificatePath( Pathname && val_r );
177 
180 
181 
183  void setClientKeyPath( Pathname && val_r );
184 
186  Pathname clientKeyPath() const;
187 
188  protected:
189  class Impl;
191  };
192 
193  } // namespace media
194 } // namespece zypp
195 
196 #endif
zypp::media::TransferSettings::verifyHostEnabled
bool verifyHostEnabled() const
Whether to verify host for ssl.
Definition: TransferSettings.cc:218
zypp::media::TransferSettings::verifyPeerEnabled
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
Definition: TransferSettings.cc:225
zypp::media::TransferSettings::setConnectTimeout
void setConnectTimeout(long t)
set the connect timeout
Definition: TransferSettings.cc:180
zypp::media::TransferSettings::userPassword
std::string userPassword() const
returns the user and password as a user:pass string
Definition: TransferSettings.cc:121
zypp::media::TransferSettings::reset
void reset()
reset the settings to the defaults
Definition: TransferSettings.cc:88
zypp::media::TransferSettings::proxyPassword
std::string proxyPassword() const
proxy auth password
Definition: TransferSettings.cc:160
zypp::media::TransferSettings::setTimeout
void setTimeout(long t)
set the transfer timeout
Definition: TransferSettings.cc:173
zypp::media::TransferSettings::setMaxSilentTries
void setMaxSilentTries(long v)
Set maximum silent retries.
Definition: TransferSettings.cc:208
zypp::media::TransferSettings::username
std::string username() const
auth username
Definition: TransferSettings.cc:112
zypp::media::TransferSettings::headersBegin
Headers::const_iterator headersBegin() const
begin iterators to additional headers
Definition: TransferSettings.cc:95
zypp::media::TransferSettings::minDownloadSpeed
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition: TransferSettings.cc:197
zypp::media::TransferSettings::certificateAuthoritiesPath
Pathname certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
Definition: TransferSettings.cc:246
zypp::media::TransferSettings::timeout
long timeout() const
transfer timeout
Definition: TransferSettings.cc:176
zypp::media::TransferSettings::authType
std::string authType() const
get the allowed authentication types
Definition: TransferSettings.cc:253
zypp::media::TransferSettings::setMaxConcurrentConnections
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
Definition: TransferSettings.cc:187
zypp::media::TransferSettings::maxConcurrentConnections
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
Definition: TransferSettings.cc:190
PtrTypes.h
Pathname.h
zypp::media::TransferSettings::proxyUserPassword
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
Definition: TransferSettings.cc:163
zypp::media::TransferSettings::headRequestsAllowed
bool headRequestsAllowed() const
whether HEAD requests are allowed
Definition: TransferSettings.cc:260
zypp::media::TransferSettings::setVerifyHostEnabled
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
Definition: TransferSettings.cc:215
zypp::media::TransferSettings::proxyEnabled
bool proxyEnabled() const
proxy is enabled
Definition: TransferSettings.cc:140
zypp::media::TransferSettings
Holds transfer setting.
Definition: TransferSettings.h:20
zypp::media::TransferSettings::setProxyEnabled
void setProxyEnabled(bool enabled)
whether the proxy is used or not
Definition: TransferSettings.cc:137
zypp::media::TransferSettings::setUsername
void setUsername(std::string &&val_r)
sets the auth username
Definition: TransferSettings.cc:109
zypp::media::TransferSettings::setClientCertificatePath
void setClientCertificatePath(Pathname &&val_r)
Sets the SSL client certificate file.
Definition: TransferSettings.cc:229
zypp::media::TransferSettings::setHeadRequestsAllowed
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
Definition: TransferSettings.cc:257
Url.h
zypp::media::TransferSettings::maxSilentTries
long maxSilentTries() const
Maximum silent retries.
Definition: TransferSettings.cc:211
zypp::media::TransferSettings::proxyUsername
std::string proxyUsername() const
proxy auth username
Definition: TransferSettings.cc:154
zypp::media::TransferSettings::setProxy
void setProxy(std::string &&val_r)
proxy to use if it is enabled
Definition: TransferSettings.cc:144
zypp::media::TransferSettings::Impl
Definition: TransferSettings.cc:21
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::media::TransferSettings::userAgentString
std::string userAgentString() const
user agent string
Definition: TransferSettings.cc:105
zypp::media::TransferSettings::clientKeyPath
Pathname clientKeyPath() const
SSL client key file.
Definition: TransferSettings.cc:239
zypp::media::TransferSettings::clientCertificatePath
Pathname clientCertificatePath() const
SSL client certificate file.
Definition: TransferSettings.cc:232
zypp::media::TransferSettings::setVerifyPeerEnabled
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
Definition: TransferSettings.cc:222
zypp::media::TransferSettings::setMaxDownloadSpeed
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
Definition: TransferSettings.cc:201
zypp::media::TransferSettings::setProxyPassword
void setProxyPassword(std::string &&val_r)
sets the proxy password
Definition: TransferSettings.cc:157
zypp::media::TransferSettings::TransferSettings
TransferSettings()
Constructs a transfer program cmd line access.
Definition: TransferSettings.cc:84
zypp::media::TransferSettings::addHeader
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar"
Definition: TransferSettings.cc:92
zypp::media::TransferSettings::Headers
std::vector< std::string > Headers
Definition: TransferSettings.h:26
zypp::media::TransferSettings::setAuthType
void setAuthType(std::string &&val_r)
set the allowed authentication types
Definition: TransferSettings.cc:250
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:44
zypp::media::TransferSettings::setClientKeyPath
void setClientKeyPath(Pathname &&val_r)
Sets the SSL client key file.
Definition: TransferSettings.cc:236
zypp::media::TransferSettings::setPassword
void setPassword(std::string &&val_r)
sets the auth password
Definition: TransferSettings.cc:115
zypp::media::TransferSettings::setMinDownloadSpeed
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
Definition: TransferSettings.cc:194
zypp::media::TransferSettings::setProxyUsername
void setProxyUsername(std::string &&val_r)
sets the proxy user
Definition: TransferSettings.cc:151
zypp::media::TransferSettings::setCertificateAuthoritiesPath
void setCertificateAuthoritiesPath(Pathname &&val_r)
Sets the SSL certificate authorities path.
Definition: TransferSettings.cc:243
zypp::RWCOW_pointer< Impl >
zypp::media::TransferSettings::connectTimeout
long connectTimeout() const
connection timeout
Definition: TransferSettings.cc:183
Flags.h
zypp::media::TransferSettings::setUserAgentString
void setUserAgentString(std::string &&val_r)
sets the user agent ie: "Mozilla v3"
Definition: TransferSettings.cc:102
zypp::media::TransferSettings::headersEnd
Headers::const_iterator headersEnd() const
end iterators to additional headers
Definition: TransferSettings.cc:98
zypp::media::TransferSettings::setAnonymousAuth
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
Definition: TransferSettings.cc:130
zypp::media::TransferSettings::proxy
std::string proxy() const
proxy host
Definition: TransferSettings.cc:147
zypp::media::TransferSettings::password
std::string password() const
auth password
Definition: TransferSettings.cc:118
zypp::media::TransferSettings::_impl
RWCOW_pointer< Impl > _impl
Definition: TransferSettings.h:189
zypp::media::TransferSettings::maxDownloadSpeed
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
Definition: TransferSettings.cc:204