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
23 /** Constructs a transfer program cmd line access. */
26 typedef std::vector<std::string> Headers;
28 /** reset the settings to the defaults */
32 /** add a header, on the form "Foo: Bar" */
33 void addHeader( std::string && val_r );
35 /** begin iterators to additional headers */
36 Headers::const_iterator headersBegin() const;
38 /** end iterators to additional headers */
39 Headers::const_iterator headersEnd() const;
42 /** sets the user agent ie: "Mozilla v3" */
43 void setUserAgentString( std::string && val_r );
45 /** user agent string */
46 std::string userAgentString() const;
49 /** sets the auth username */
50 void setUsername( std::string && val_r );
53 std::string username() const;
55 /** sets the auth password */
56 void setPassword( std::string && val_r );
59 std::string password() const;
61 /** returns the user and password as a user:pass string */
62 std::string userPassword() const;
64 /** sets anonymous authentication (ie: for ftp) */
65 void setAnonymousAuth();
68 /** whether the proxy is used or not */
69 void setProxyEnabled( bool enabled );
71 /** proxy is enabled */
72 bool proxyEnabled() const;
75 /** proxy to use if it is enabled */
76 void setProxy( std::string && val_r );
79 std::string proxy() const;
82 /** sets the proxy user */
83 void setProxyUsername( std::string && val_r );
85 /** proxy auth username */
86 std::string proxyUsername() const;
88 /** sets the proxy password */
89 void setProxyPassword( std::string && val_r );
91 /** proxy auth password */
92 std::string proxyPassword() const;
94 /** returns the proxy user and password as a user:pass string */
95 std::string proxyUserPassword() const;
98 /** set the connect timeout */
99 void setConnectTimeout( long t );
101 /** connection timeout */
102 long connectTimeout() const;
105 /** set the transfer timeout */
106 void setTimeout( long t );
108 /** transfer timeout */
109 long timeout() const;
112 /** Set maximum number of concurrent connections for a single transfer */
113 void setMaxConcurrentConnections(long v);
115 /** Maximum number of concurrent connections for a single transfer */
116 long maxConcurrentConnections() const;
119 /** Set minimum download speed (bytes per second) until the connection is dropped */
120 void setMinDownloadSpeed(long v);
122 /** Minimum download speed (bytes per second) until the connection is dropped */
123 long minDownloadSpeed() const;
126 /** Set max download speed (bytes per second) */
127 void setMaxDownloadSpeed(long v);
129 /** Maximum download speed (bytes per second) */
130 long maxDownloadSpeed() const;
133 /** Set maximum silent retries */
134 void setMaxSilentTries(long v);
136 /** Maximum silent retries */
137 long maxSilentTries() const;
140 /** Sets whether to verify host for ssl */
141 void setVerifyHostEnabled( bool enabled );
143 /** Whether to verify host for ssl */
144 bool verifyHostEnabled() const;
147 /** Sets whether to verify host for ssl */
148 void setVerifyPeerEnabled( bool enabled );
150 /** Whether to verify peer for ssl */
151 bool verifyPeerEnabled() const;
154 /** Sets the SSL certificate authorities path */
155 void setCertificateAuthoritiesPath( Pathname && val_r );
157 /** SSL certificate authorities path ( default: /etc/ssl/certs ) */
158 Pathname certificateAuthoritiesPath() const;
161 /** set the allowed authentication types */
162 void setAuthType( std::string && val_r );
164 /** get the allowed authentication types */
165 std::string authType() const;
168 /** set whether HEAD requests are allowed */
169 void setHeadRequestsAllowed(bool allowed);
171 /** whether HEAD requests are allowed */
172 bool headRequestsAllowed() const;
175 /** Sets the SSL client certificate file */
176 void setClientCertificatePath( Pathname && val_r );
178 /** SSL client certificate file */
179 Pathname clientCertificatePath() const;
182 /** Sets the SSL client key file */
183 void setClientKeyPath( Pathname && val_r );
185 /** SSL client key file */
186 Pathname clientKeyPath() const;
190 RWCOW_pointer<Impl> _impl;