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