This repository was archived by the owner on Jul 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 442
Expand file tree
/
Copy pathConstants.java
More file actions
382 lines (344 loc) · 13.4 KB
/
Constants.java
File metadata and controls
382 lines (344 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds;
import org.jclouds.location.reference.LocationConstants;
/**
* Constants used in jclouds services.
*/
public final class Constants {
/**
* Integer property. default (0)
* <p/>
* Amount of threads servicing the user requests and transformations
*/
public static final String PROPERTY_USER_THREADS = "jclouds.user-threads";
/**
* Integer property. default (20)
* <p/>
* Amount of threads servicing the I/O of http connections.
*
* @deprecated No longer used. Will be removed in jclouds v2
*/
@Deprecated
public static final String PROPERTY_IO_WORKER_THREADS = "jclouds.io-worker-threads";
/**
* Integer property. default (10)
* <p/>
* Amount of threads servicing scheduled tasks.
*/
public static final String PROPERTY_SCHEDULER_THREADS = "jclouds.scheduler-threads";
/**
* Integer property. default (20)
* <p/>
* Limits the amount of connections per context.
*/
public static final String PROPERTY_MAX_CONNECTIONS_PER_CONTEXT = "jclouds.max-connections-per-context";
/**
* Integer property. default (0)
* <p/>
* Limits the amount of connections per host. 0 means indirectly limited by
* {@link #PROPERTY_MAX_CONNECTIONS_PER_CONTEXT}.
*/
public static final String PROPERTY_MAX_CONNECTIONS_PER_HOST = "jclouds.max-connections-per-host";
/**
* Integer property. default (2)
* <p/>
* Maximum amount of http session failures before a pool is disabled.
*/
public static final String PROPERTY_MAX_SESSION_FAILURES = "jclouds.max-session-failures";
/**
* Integer property. default (75)
* <p/>
* Maximum amount of times to re_use an http connection. Services like Amazon S3 throw errors if
* connections are reused too many times.
*/
public static final String PROPERTY_MAX_CONNECTION_REUSE = "jclouds.max-connection-reuse";
/**
* int property. default (60000)
* <p/>
* How many milliseconds to wait before a socket connection times out. 0 means infinity.
*/
public static final String PROPERTY_SO_TIMEOUT = "jclouds.so-timeout";
/**
* Long property. default (60000)
* <p/>
* How many milliseconds to wait before a connection times out. 0 means infinity.
*/
public static final String PROPERTY_CONNECTION_TIMEOUT = "jclouds.connection-timeout";
/**
* Long property. default (60)
* <p/>
* How many seconds to wait before creating a new session
*/
public static final String PROPERTY_SESSION_INTERVAL = "jclouds.session-interval";
/**
* Boolean property.
* <p/>
* Whether or not to attempt to use the proxy setup from the underlying operating system.
* Defaults to false.
* Only considered if {@link #PROPERTY_PROXY_ENABLE_JVM_PROXY} is false
* and {@link #PROPERTY_PROXY_HOST} is not supplied.
* Due to how Java's <code>java.net.useSystemProxies</code> is handled,
* this may have limited effectiveness.
* @deprecated in 2.0.0, replaced by {@link #PROPERTY_PROXY_ENABLE_JVM_PROXY} does what this intended but better
*/
@Deprecated
// deprecated because: the impl attempts to set the corresponding JVM system property
// but that is documented to have no effect if set after system startup;
// see e.g. https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html
public static final String PROPERTY_PROXY_SYSTEM = "jclouds.use-system-proxy";
/**
* Boolean property.
* <p/>
* Whether or not jclouds is permitted to use the default proxy detected by the JVM
* and configured there using the usual Java settings:
* <ul>
* <li> <code>java.net.useSystemProxies</code>
* <li> <code>java.net.httpProxyHost</code>
* <li> <code>java.net.httpProxyPort</code>
* </ul>
* <p/>
* Defaults to true so that the Java standard way of setting proxies can be used.
* However if {@link #PROPERTY_PROXY_HOST} is set that will always take priority
* when jclouds looks for a proxy.
* If this property is explicitly set <code>false</code>,
* then jclouds will not use a proxy irrespective of the <code>java.net.*</code> settings,
* unless {@link #PROPERTY_PROXY_HOST} is set or {@link #PROPERTY_PROXY_SYSTEM} is true.
*/
public static final String PROPERTY_PROXY_ENABLE_JVM_PROXY = "jclouds.enable-jvm-proxy";
/**
* String property.
* <p/>
*Explicitly sets the host name of a proxy server.
*/
public static final String PROPERTY_PROXY_HOST = "jclouds.proxy-host";
/**
* Integer property. default is 80 when {@link #PROPERTY_PROXY_TYPE} is
* {@code HTTP}, and 1080 when {@link #PROPERTY_PROXY_TYPE} is {@code SOCKS}.
* <p/>
* Explicitly sets the port number of a proxy server.
*/
public static final String PROPERTY_PROXY_PORT = "jclouds.proxy-port";
/**
* String property. default {@code HTTP}, valid options: {@code HTTP}, {@code SOCKS}.
* <p/>
* Explicitly sets the type of a proxy server.
*
* @see Proxy.Type
*/
public static final String PROPERTY_PROXY_TYPE = "jclouds.proxy-type";
/**
* String property.
* <p/>
* Explicitly sets the user name credential for proxy authentication.
* This only applies when {@link #PROPERTY_PROXY_HOST} is supplied.
*/
public static final String PROPERTY_PROXY_USER = "jclouds.proxy-user";
/**
* String property.
* <p/>
* Explicitly sets the password credential for proxy authentication.
* This only applies when {@link #PROPERTY_PROXY_HOST} is supplied.
*/
public static final String PROPERTY_PROXY_PASSWORD = "jclouds.proxy-password";
/**
* Boolean property. Default true.
* <p/>
* If a proxy server is configured, it will be used for all types of schemes.
* Set to false to not use a proxy server for sockets (such as ssh access).
*/
public static final String PROPERTY_PROXY_FOR_SOCKETS = "jclouds.proxy-for-sockets";
/**
* Integer property.
* <p/>
* Commands are retried, if the problem on the server side was a resolvable conflict. However,
* the maximum tries of a single command is bounded.
*/
public static final String PROPERTY_MAX_RETRIES = "jclouds.max-retries";
/**
* Long property.
* <p/>
* Commands are retried, if the problem on the server side was a resolvable conflict. However,
* the maximum tries of a single command is bounded. If {@link #PROPERTY_MAX_RETRIES} is greater
* than zero, this property is used to determine the start delay. The delay is based on exponential
* backoff algorithm. Default value for this property is 50 milliseconds.
*/
public static final String PROPERTY_RETRY_DELAY_START = "jclouds.retries-delay-start";
/**
* Integer property.
* <p/>
* Commands are limited to only a certain amount of redirects.
*/
public static final String PROPERTY_MAX_REDIRECTS = "jclouds.max-redirects";
/**
* Long property.
* <p/>
* Maximum duration in milliseconds a single request can take before throwing an exception.
*/
public static final String PROPERTY_REQUEST_TIMEOUT = "jclouds.request-timeout";
/**
* Boolean property.
* <p/>
* allow mismatch between hostname and ssl certificate. Set to true in DNS_based services like
* Amazon S3.
*/
public static final String PROPERTY_RELAX_HOSTNAME = "jclouds.relax-hostname";
/**
* Boolean property.
* <p/>
* trust self-signed certs
*/
public static final String PROPERTY_TRUST_ALL_CERTS = "jclouds.trust-all-certs";
/**
* Boolean property.
* <p/>
* true to allow logging of sensitive information like passwords in the wire log
* default value is false
*/
public static final String PROPERTY_LOGGER_WIRE_LOG_SENSITIVE_INFO = "jclouds.wire.log.sensitive";
/**
* Name of the logger that records all http headers from the client and the server.
*/
public static final String LOGGER_HTTP_HEADERS = "jclouds.headers";
/**
* Name of the logger that records the content sent to and from the server.
*/
public static final String LOGGER_HTTP_WIRE = "jclouds.wire";
/**
* Name of the logger that records the steps of the request signing process of the HTTP_service.
*/
public static final String LOGGER_SIGNATURE = "jclouds.signature";
/**
* String property.
* <p/>
* Explicitly identifies a provider of an api
*/
public static final String PROPERTY_PROVIDER = "jclouds.provider";
/**
* String property.
* <p/>
* Explicitly identifies the name of a product that a provider may run
*/
public static final String PROPERTY_API = "jclouds.api";
/**
* String property. default empty string
* <p/>
* Explicitly identifies the version of an api.
*/
public static final String PROPERTY_API_VERSION = "jclouds.api-version";
/**
* String property.
* <p/>
* Explicitly identifies the build that the server jclouds connects to is running.
*
* For example, for virtualbox, the api version may be {@code 4.1.8} while the build version is
* {@code 4.1.8r75467}.
*/
public static final String PROPERTY_BUILD_VERSION = "jclouds.build-version";
/**
* String property.
* <p/>
* Explicitly identifies the most top-level endpoint to a service provider. This helps
* differentiate two providers of the same api, or a different environments providing the same
* api.
*/
public static final String PROPERTY_ENDPOINT = "jclouds.endpoint";
/**
* String property.
* <p/>
* Explicitly sets the login identity into a provider
*/
public static final String PROPERTY_IDENTITY = "jclouds.identity";
/**
* String property. default("")
* <p/>
* comma-delimited iso 3166 codes; ex. US-CA,US
*
* @see Location#getIso3166Codes
*/
public static final String PROPERTY_ISO3166_CODES = "jclouds." + LocationConstants.ISO3166_CODES;
/**
* String property.
* <p/>
* Explicitly sets the secret, which when combined with the identity, will create an
* authenticated subject or session
*/
public static final String PROPERTY_CREDENTIAL = "jclouds.credential";
/**
* Long properties
* <p/>
* Overrides timeouts on sync interfaces. Timeout value is in ms.
* Here's an example of an override for a single method:
* <p/>
* <code>
* #10 seconds <br/>
* jclouds.timeouts.S3Client.bucketExists=10000
* </code>
* <p/>
* Or for all methods:
* <p/>
* <code>
* jclouds.timeouts.GridServerClient = 350000
* </code>
*/
public static final String PROPERTY_TIMEOUTS_PREFIX = "jclouds.timeouts.";
/**
* Integer property. Default (32768).
* <p/>
* Buffer size for socket write (currently honored only by the default
* Java URL HTTP client, JavaUrlHttpCommandExcecutorService).
*/
public static final String PROPERTY_OUTPUT_SOCKET_BUFFER_SIZE = "jclouds.output-socket-buffer-size";
/**
* Boolean property. Default (true).
* <p/>
* Configures the response parsers to pretty print the payload when possible.
*/
public static final String PROPERTY_PRETTY_PRINT_PAYLOADS = "jclouds.payloads.pretty-print";
/**
* When true, strip the Expect: 100-continue header. Useful when interacting with
* providers that don't properly support Expect headers. Defaults to false.
*/
public static final String PROPERTY_STRIP_EXPECT_HEADER = "jclouds.strip-expect-header";
/**
* String property.
* <p/>
* This will override the user agent header in http request.
*/
public static final String PROPERTY_USER_AGENT = "jclouds.user-agent";
/**
* When true, add the Connection: close header. Useful when interacting with
* providers that don't properly support persistent connections. Defaults to false.
*/
public static final String PROPERTY_CONNECTION_CLOSE_HEADER = "jclouds.connection-close-header";
/**
* The maximum number of blob deletes happening in parallel at any point in time.
*/
public static final String PROPERTY_MAX_PARALLEL_DELETES = "jclouds.max-parallel-deletes";
/** Comma-separated list of methods considered idempotent for purposes of retries. By default jclouds uses DELETE,GET,HEAD,OPTIONS,PUT. */
public static final String PROPERTY_IDEMPOTENT_METHODS = "jclouds.idempotent-methods";
/**
* Maximum amount of time (in milliseconds) a request will wait until retrying if
* the rate limit is exhausted.
* <p>
* Default value: 2 minutes.
*/
public static final String PROPERTY_MAX_RATE_LIMIT_WAIT = "jclouds.max-ratelimit-wait";
private Constants() {
throw new AssertionError("intentionally unimplemented");
}
}