libzypp  16.20.4
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:
27 
34 
35  typedef std::vector<std::string> Headers;
36 
40  void reset();
41 
45  void addHeader( const std::string &header );
46 
50  Headers::const_iterator headersBegin() const;
51 
55  Headers::const_iterator headersEnd() const;
56 
60  void setUserAgentString( const std::string &agent );
61 
65  std::string userAgentString() const;
66 
70  void setUsername( const std::string &username );
71 
75  std::string username() const;
76 
80  void setPassword( const std::string &password );
81 
85  std::string password() const;
86 
91  std::string userPassword() const;
92 
96  void setAnonymousAuth();
97 
101  void setProxyEnabled( bool enabled );
102 
106  bool proxyEnabled() const;
107 
111  void setProxy( const std::string &proxyhost );
112 
116  std::string proxy() const;
117 
121  void setProxyUsername( const std::string &proxyuser );
122 
126  std::string proxyUsername() const;
127 
131  void setProxyPassword( const std::string &proxypass );
132 
136  std::string proxyPassword() const;
137 
142  std::string proxyUserPassword() const;
143 
147  void setConnectTimeout( long t );
148 
152  long connectTimeout() const;
153 
157  void setTimeout( long t );
158 
162  long timeout() const;
163 
167  long maxConcurrentConnections() const;
168 
172  void setMaxConcurrentConnections(long v);
173 
178  long minDownloadSpeed() const;
179 
184  void setMinDownloadSpeed(long v);
185 
189  long maxDownloadSpeed() const;
190 
194  void setMaxDownloadSpeed(long v);
195 
199  long maxSilentTries() const;
200 
204  void setMaxSilentTries(long v);
205 
209  bool verifyHostEnabled() const;
210 
214  void setVerifyHostEnabled( bool enabled );
215 
219  bool verifyPeerEnabled() const;
220 
224  void setVerifyPeerEnabled( bool enabled );
225 
231 
235  void setCertificateAuthoritiesPath( const zypp::Pathname &path );
236 
240  void setAuthType( const std::string &authtype );
241 
245  std::string authType() const;
246 
250  void setHeadRequestsAllowed(bool allowed);
251 
255  bool headRequestsAllowed() const;
256 
261 
265  void setClientCertificatePath( const zypp::Pathname &path );
266 
270  Pathname clientKeyPath() const;
271 
275  void setClientKeyPath( const zypp::Pathname &path );
276 
277 protected:
278  class Impl;
280 };
281 
282 } // ns media
283 } // ns zypp
284 
285 #endif
Url url
Definition: MediaCurl.cc:199
Url manipulation class.
Definition: Url.h:88
Holds transfer setting.
std::string proxy() const
proxy host
void setProxyEnabled(bool enabled)
whether the proxy is used or not
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
void setProxy(const std::string &proxyhost)
proxy to use if it is enabled
TransferSettings()
Constructs a transfer program cmd line access.
void setCertificateAuthoritiesPath(const zypp::Pathname &path)
Sets the SSL certificate authorities path.
long connectTimeout() const
connection timeout
std::string password() const
auth password
long timeout() const
transfer timeout
Headers::const_iterator headersEnd() const
end iterators to additional headers
void setUsername(const std::string &username)
sets the auth username
void addHeader(const std::string &header)
add a header, on the form "Foo: Bar"
std::string proxyPassword() const
proxy auth password
void reset()
reset the settings to the defaults
long maxSilentTries() const
Maximum silent retries.
void setPassword(const std::string &password)
sets the auth password
TransferSettings(const zypp::Url &url)
Constructs the settings from a url object where.
void setAuthType(const std::string &authtype)
set the allowed authentication types
std::string userPassword() const
returns the user and password as a user:pass string
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
void setClientCertificatePath(const zypp::Pathname &path)
Sets the SSL client certificate file.
void setConnectTimeout(long t)
set the connect timeout
std::string userAgentString() const
user agent string
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
bool verifyHostEnabled() const
Whether to verify host for ssl.
Pathname clientCertificatePath() const
SSL client certificate file.
Pathname certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
bool headRequestsAllowed() const
whether HEAD requests are allowed
std::string proxyUsername() const
proxy auth username
std::string authType() const
get the allowed authentication types
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
void setProxyPassword(const std::string &proxypass)
sets the proxy password
bool proxyEnabled() const
proxy is enabled
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
std::string username() const
auth username
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
std::vector< std::string > Headers
void setUserAgentString(const std::string &agent)
sets the user agent ie: "Mozilla v3"
RWCOW_pointer< Impl > _impl
void setProxyUsername(const std::string &proxyuser)
sets the proxy user
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
Pathname clientKeyPath() const
SSL client key file.
void setTimeout(long t)
set the transfer timeout
void setClientKeyPath(const zypp::Pathname &path)
Sets the SSL client key file.
void setMaxSilentTries(long v)
Set maximum silent retries.
Headers::const_iterator headersBegin() const
begin iterators to additional headers
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2