2 #ifndef TRANSFER_SETTINGS_H_
3 #define TRANSFER_SETTINGS_H_
7 #include "zypp/base/Flags.h"
8 #include "zypp/base/PtrTypes.h"
9 #include "zypp/Pathname.h"
18 * Holds transfer setting
20 class TransferSettings
24 * Constructs a transfer program cmd line access.
29 * Constructs the settings from a url object where.
30 * authentication/proxy information can be extracted
33 TransferSettings( const zypp::Url &url );
35 typedef std::vector<std::string> Headers;
38 * reset the settings to the defaults
43 * add a header, on the form "Foo: Bar"
45 void addHeader( const std::string &header );
48 * begin iterators to additional headers
50 Headers::const_iterator headersBegin() const;
53 * end iterators to additional headers
55 Headers::const_iterator headersEnd() const;
58 * sets the user agent ie: "Mozilla v3"
60 void setUserAgentString( const std::string &agent );
65 std::string userAgentString() const;
68 * sets the auth username
70 void setUsername( const std::string &username );
75 std::string username() const;
78 * sets the auth password
80 void setPassword( const std::string &password );
85 std::string password() const;
88 * returns the user and password as
91 std::string userPassword() const;
94 * sets anonymous authentication (ie: for ftp)
96 void setAnonymousAuth();
99 * whether the proxy is used or not
101 void setProxyEnabled( bool enabled );
106 bool proxyEnabled() const;
109 * proxy to use if it is enabled
111 void setProxy( const std::string &proxyhost );
116 std::string proxy() const;
119 * sets the proxy user
121 void setProxyUsername( const std::string &proxyuser );
124 * proxy auth username
126 std::string proxyUsername() const;
129 * sets the proxy password
131 void setProxyPassword( const std::string &proxypass );
134 * proxy auth password
136 std::string proxyPassword() const;
139 * returns the proxy user and password as
142 std::string proxyUserPassword() const;
145 * set the connect timeout
147 void setConnectTimeout( long t );
152 long connectTimeout() const;
155 * set the transfer timeout
157 void setTimeout( long t );
162 long timeout() const;
165 * Maximum number of concurrent connections for a single transfer
167 long maxConcurrentConnections() const;
170 * Set maximum number of concurrent connections for a single transfer
172 void setMaxConcurrentConnections(long v);
175 * Minimum download speed (bytes per second)
176 * until the connection is dropped
178 long minDownloadSpeed() const;
181 * Set minimum download speed (bytes per second)
182 * until the connection is dropped
184 void setMinDownloadSpeed(long v);
187 * Maximum download speed (bytes per second)
189 long maxDownloadSpeed() const;
192 * Set max download speed (bytes per second)
194 void setMaxDownloadSpeed(long v);
197 * Maximum silent retries
199 long maxSilentTries() const;
202 * Set maximum silent retries
204 void setMaxSilentTries(long v);
207 * Whether to verify host for ssl
209 bool verifyHostEnabled() const;
212 * Sets whether to verify host for ssl
214 void setVerifyHostEnabled( bool enabled );
217 * Whether to verify peer for ssl
219 bool verifyPeerEnabled() const;
222 * Sets whether to verify host for ssl
224 void setVerifyPeerEnabled( bool enabled );
227 * SSL certificate authorities path
228 * ( default: /etc/ssl/certs )
230 Pathname certificateAuthoritiesPath() const;
233 * Sets the SSL certificate authorities path
235 void setCertificateAuthoritiesPath( const zypp::Pathname &path );
238 * set the allowed authentication types
240 void setAuthType( const std::string &authtype );
243 * get the allowed authentication types
245 std::string authType() const;
248 * set whether HEAD requests are allowed
250 void setHeadRequestsAllowed(bool allowed);
253 * whether HEAD requests are allowed
255 bool headRequestsAllowed() const;
258 * SSL client certificate file
260 Pathname clientCertificatePath() const;
263 * Sets the SSL client certificate file
265 void setClientCertificatePath( const zypp::Pathname &path );
268 * SSL client key file
270 Pathname clientKeyPath() const;
273 * Sets the SSL client key file
275 void setClientKeyPath( const zypp::Pathname &path );
279 RWCOW_pointer<Impl> _impl;