libzypp  17.28.5
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::proto {
13  class TransferSettings;
14 }
15 
16 namespace zypp
17 {
18  namespace media
19  {
20 
25  {
26  public:
29 
30  TransferSettings( const zypp::proto::TransferSettings &settings );
31 
32  typedef std::vector<std::string> Headers;
33 
35  void reset();
36 
37 
39  void addHeader( std::string && val_r );
40 
42  Headers headers() const;
43 
45  void setUserAgentString( std::string && val_r );
46 
48  std::string userAgentString() const;
49 
50 
52  void setUsername( std::string && val_r );
53 
55  std::string username() const;
56 
58  void setPassword( std::string && val_r );
59 
61  std::string password() const;
62 
64  std::string userPassword() const;
65 
67  void setAnonymousAuth();
68 
69 
71  void setProxyEnabled( bool enabled );
72 
74  bool proxyEnabled() const;
75 
76 
78  void setProxy( std::string && val_r );
79 
81  std::string proxy() const;
82 
83 
85  void setProxyUsername( std::string && val_r );
86 
88  std::string proxyUsername() const;
89 
91  void setProxyPassword( std::string && val_r );
92 
94  std::string proxyPassword() const;
95 
97  std::string proxyUserPassword() const;
98 
99 
101  void setConnectTimeout( long t );
102 
104  long connectTimeout() const;
105 
106 
108  void setTimeout( long t );
109 
111  long timeout() const;
112 
113 
115  void setMaxConcurrentConnections(long v);
116 
118  long maxConcurrentConnections() const;
119 
120 
122  void setMinDownloadSpeed(long v);
123 
125  long minDownloadSpeed() const;
126 
127 
129  void setMaxDownloadSpeed(long v);
130 
132  long maxDownloadSpeed() const;
133 
134 
136  void setMaxSilentTries(long v);
137 
139  long maxSilentTries() const;
140 
141 
143  void setVerifyHostEnabled( bool enabled );
144 
146  bool verifyHostEnabled() const;
147 
148 
150  void setVerifyPeerEnabled( bool enabled );
151 
153  bool verifyPeerEnabled() const;
154 
155 
157  void setCertificateAuthoritiesPath( Pathname && val_r );
158 
161 
162 
164  void setAuthType( std::string && val_r );
165 
167  std::string authType() const;
168 
169 
171  void setHeadRequestsAllowed(bool allowed);
172 
174  bool headRequestsAllowed() const;
175 
176 
178  void setClientCertificatePath( Pathname && val_r );
179 
182 
183 
185  void setClientKeyPath( Pathname && val_r );
186 
188  Pathname clientKeyPath() const;
189 
190  const zypp::proto::TransferSettings &protoData() const;
191  zypp::proto::TransferSettings &protoData();
192 
193  protected:
194  class Impl;
196  };
197 
198  } // namespace media
199 } // namespece zypp
200 
201 #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
Headers headers() const
returns a list of all added headers
void setConnectTimeout(long t)
set the connect timeout
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
void setProxyUsername(std::string &&val_r)
sets the proxy user
Pathname clientKeyPath() const
SSL client key file.
const zypp::proto::TransferSettings & protoData() const
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