libzypp  13.10.6
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 
33  TransferSettings( const zypp::Url &url );
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 
230  Pathname certificateAuthoritiesPath() const;
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 
260  Pathname clientCertificatePath() const;
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
std::string userPassword() const
returns the user and password as a user:pass string
bool verifyHostEnabled() const
Whether to verify host for ssl.
Pathname clientKeyPath() const
SSL client key file.
long connectTimeout() const
connection timeout
Headers::const_iterator headersEnd() const
end iterators to additional headers
void setClientKeyPath(const zypp::Pathname &path)
Sets the SSL client key file.
Holds transfer setting.
void setProxyUsername(const std::string &proxyuser)
sets the proxy user
Pathname certificateAuthoritiesPath() const
SSL certificate authorities path ( default: /etc/ssl/certs )
std::string password() const
auth password
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
long minDownloadSpeed() const
Minimum download speed (bytes per second) until the connection is dropped.
void setConnectTimeout(long t)
set the connect timeout
void setProxy(const std::string &proxyhost)
proxy to use if it is enabled
void setPassword(const std::string &password)
sets the auth password
void setUsername(const std::string &username)
sets the auth username
bool headRequestsAllowed() const
whether HEAD requests are allowed
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
std::string userAgentString() const
user agent string
void setProxyPassword(const std::string &proxypass)
sets the proxy password
void setAuthType(const std::string &authtype)
set the allowed authentication types
std::vector< std::string > Headers
TransferSettings()
Constructs a transfer program cmd line access.
void setMaxSilentTries(long v)
Set maximum silent retries.
bool verifyPeerEnabled() const
Whether to verify peer for ssl.
zypp::Url url
Definition: MediaCurl.cc:193
void setTimeout(long t)
set the transfer timeout
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
RWCOW_pointer< Impl > _impl
void setMaxDownloadSpeed(long v)
Set max download speed (bytes per second)
Headers::const_iterator headersBegin() const
begin iterators to additional headers
void setClientCertificatePath(const zypp::Pathname &path)
Sets the SSL client certificate file.
void reset()
reset the settings to the defaults
void setMaxConcurrentConnections(long v)
Set maximum number of concurrent connections for a single transfer.
void addHeader(const std::string &header)
add a header, on the form &quot;Foo: Bar&quot;
void setCertificateAuthoritiesPath(const zypp::Pathname &path)
Sets the SSL certificate authorities path.
std::string proxyPassword() const
proxy auth password
long maxConcurrentConnections() const
Maximum number of concurrent connections for a single transfer.
long maxSilentTries() const
Maximum silent retries.
std::string authType() const
get the allowed authentication types
void setMinDownloadSpeed(long v)
Set minimum download speed (bytes per second) until the connection is dropped.
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
Pathname clientCertificatePath() const
SSL client certificate file.
std::string proxy() const
proxy host
bool proxyEnabled() const
proxy is enabled
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
Url manipulation class.
Definition: Url.h:87
void setUserAgentString(const std::string &agent)
sets the user agent ie: &quot;Mozilla v3&quot;
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
void setProxyEnabled(bool enabled)
whether the proxy is used or not
std::string username() const
auth username
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:438
std::string proxyUsername() const
proxy auth username
long timeout() const
transfer timeout