libzypp  17.24.1
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:
25 
26  typedef std::vector<std::string> Headers;
27 
29  void reset();
30 
31 
33  void addHeader( std::string && val_r );
34 
36  Headers::const_iterator headersBegin() const;
37 
39  Headers::const_iterator headersEnd() const;
40 
41 
43  void setUserAgentString( std::string && val_r );
44 
46  std::string userAgentString() const;
47 
48 
50  void setUsername( std::string && val_r );
51 
53  std::string username() const;
54 
56  void setPassword( std::string && val_r );
57 
59  std::string password() const;
60 
62  std::string userPassword() const;
63 
65  void setAnonymousAuth();
66 
67 
69  void setProxyEnabled( bool enabled );
70 
72  bool proxyEnabled() const;
73 
74 
76  void setProxy( std::string && val_r );
77 
79  std::string proxy() const;
80 
81 
83  void setProxyUsername( std::string && val_r );
84 
86  std::string proxyUsername() const;
87 
89  void setProxyPassword( std::string && val_r );
90 
92  std::string proxyPassword() const;
93 
95  std::string proxyUserPassword() const;
96 
97 
99  void setConnectTimeout( long t );
100 
102  long connectTimeout() const;
103 
104 
106  void setTimeout( long t );
107 
109  long timeout() const;
110 
111 
113  void setMaxConcurrentConnections(long v);
114 
116  long maxConcurrentConnections() const;
117 
118 
120  void setMinDownloadSpeed(long v);
121 
123  long minDownloadSpeed() const;
124 
125 
127  void setMaxDownloadSpeed(long v);
128 
130  long maxDownloadSpeed() const;
131 
132 
134  void setMaxSilentTries(long v);
135 
137  long maxSilentTries() const;
138 
139 
141  void setVerifyHostEnabled( bool enabled );
142 
144  bool verifyHostEnabled() const;
145 
146 
148  void setVerifyPeerEnabled( bool enabled );
149 
151  bool verifyPeerEnabled() const;
152 
153 
155  void setCertificateAuthoritiesPath( Pathname && val_r );
156 
159 
160 
162  void setAuthType( std::string && val_r );
163 
165  std::string authType() const;
166 
167 
169  void setHeadRequestsAllowed(bool allowed);
170 
172  bool headRequestsAllowed() const;
173 
174 
176  void setClientCertificatePath( Pathname && val_r );
177 
180 
181 
183  void setClientKeyPath( Pathname && val_r );
184 
186  Pathname clientKeyPath() const;
187 
188  protected:
189  class Impl;
191  };
192 
193  } // namespace media
194 } // namespece zypp
195 
196 #endif
long timeout() const
transfer timeout
std::string authType() const
get the allowed authentication types
std::string password() const
auth password
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar"
void setAuthType(std::string &&val_r)
set the allowed authentication types
std::string proxyUserPassword() const
returns the proxy user and password as a user:pass string
Pathname clientCertificatePath() const
SSL client certificate file.
void setUsername(std::string &&val_r)
sets the auth username
long maxDownloadSpeed() const
Maximum download speed (bytes per second)
std::string proxy() const
proxy host
Holds transfer setting.
bool verifyHostEnabled() const
Whether to verify host for ssl.
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
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 setClientCertificatePath(Pathname &&val_r)
Sets the SSL client certificate file.
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(std::string &&val_r)
sets the proxy password
long connectTimeout() const
connection timeout
void setClientKeyPath(Pathname &&val_r)
Sets the SSL client key file.
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
void setProxyUsername(std::string &&val_r)
sets the proxy user
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.
bool proxyEnabled() const
proxy is enabled
void setProxy(std::string &&val_r)
proxy to use if it 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 setUserAgentString(std::string &&val_r)
sets the user agent ie: "Mozilla v3"
std::string userPassword() const
returns the user and password as a user:pass string
void setPassword(std::string &&val_r)
sets the auth password
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 setCertificateAuthoritiesPath(Pathname &&val_r)
Sets the SSL certificate authorities path.
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
bool headRequestsAllowed() const
whether HEAD requests are allowed
void setProxyEnabled(bool enabled)
whether the proxy is used or not