|
| 1 | +// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved. |
| 2 | +// Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. |
1 | 3 | package oracle.kubernetes.operator.builders;
|
2 | 4 |
|
3 | 5 | import io.kubernetes.client.ProgressRequestBody;
|
4 | 6 | import io.kubernetes.client.ProgressResponseBody;
|
5 | 7 |
|
6 |
| -public class CallParams { |
7 |
| - private static final int DEFAULT_LIMIT = 500; |
8 |
| - private static final int DEFAULT_TIMEOUT = 30; |
9 |
| - |
10 |
| - private Boolean includeUninitialized; |
11 |
| - private Integer limit = CallParams.DEFAULT_LIMIT; |
12 |
| - private Integer timeoutSeconds = CallParams.DEFAULT_TIMEOUT; |
13 |
| - private String fieldSelector; |
14 |
| - private String labelSelector; |
15 |
| - private String pretty; |
16 |
| - private String resourceVersion; |
17 |
| - private ProgressResponseBody.ProgressListener progressListener; |
18 |
| - private ProgressRequestBody.ProgressRequestListener progressRequestListener; |
19 |
| - |
20 |
| - public Boolean getIncludeUninitialized() { |
21 |
| - return includeUninitialized; |
22 |
| - } |
23 |
| - |
24 |
| - public Integer getLimit() { |
25 |
| - return limit; |
26 |
| - } |
27 |
| - |
28 |
| - public Integer getTimeoutSeconds() { |
29 |
| - return timeoutSeconds; |
30 |
| - } |
31 |
| - |
32 |
| - public String getFieldSelector() { |
33 |
| - return fieldSelector; |
34 |
| - } |
35 |
| - |
36 |
| - public String getLabelSelector() { |
37 |
| - return labelSelector; |
38 |
| - } |
39 |
| - |
40 |
| - public String getPretty() { |
41 |
| - return pretty; |
42 |
| - } |
43 |
| - |
44 |
| - public String getResourceVersion() { |
45 |
| - return resourceVersion; |
46 |
| - } |
47 |
| - |
48 |
| - public ProgressResponseBody.ProgressListener getProgressListener() { |
49 |
| - return progressListener; |
50 |
| - } |
51 |
| - |
52 |
| - public ProgressRequestBody.ProgressRequestListener getProgressRequestListener() { |
53 |
| - return progressRequestListener; |
54 |
| - } |
55 |
| - |
56 |
| - void setIncludeUninitialized(Boolean includeUninitialized) { |
57 |
| - this.includeUninitialized = includeUninitialized; |
58 |
| - } |
59 |
| - |
60 |
| - void setLimit(Integer limit) { |
61 |
| - this.limit = limit; |
62 |
| - } |
63 |
| - |
64 |
| - void setTimeoutSeconds(Integer timeoutSeconds) { |
65 |
| - this.timeoutSeconds = timeoutSeconds; |
66 |
| - } |
67 |
| - |
68 |
| - void setFieldSelector(String fieldSelector) { |
69 |
| - this.fieldSelector = fieldSelector; |
70 |
| - } |
71 |
| - |
72 |
| - void setLabelSelector(String labelSelector) { |
73 |
| - this.labelSelector = labelSelector; |
74 |
| - } |
75 |
| - |
76 |
| - void setPretty(String pretty) { |
77 |
| - this.pretty = pretty; |
78 |
| - } |
79 |
| - |
80 |
| - void setResourceVersion(String resourceVersion) { |
81 |
| - this.resourceVersion = resourceVersion; |
82 |
| - } |
83 |
| - |
84 |
| - void setProgressListener(ProgressResponseBody.ProgressListener progressListener) { |
85 |
| - this.progressListener = progressListener; |
86 |
| - } |
87 |
| - |
88 |
| - void setProgressRequestListener(ProgressRequestBody.ProgressRequestListener progressRequestListener) { |
89 |
| - this.progressRequestListener = progressRequestListener; |
90 |
| - } |
| 8 | +public interface CallParams { |
| 9 | + /** |
| 10 | + * Returns a boolean indicating whether partially initialized results should be included in the response. |
| 11 | + * @return the current setting of the parameter. Defaults to including everything. |
| 12 | + */ |
| 13 | + Boolean getIncludeUninitialized(); |
| 14 | + |
| 15 | + /** |
| 16 | + * Returns the limit on the number of updates to send in a single reply. |
| 17 | + * @return the current setting of the parameter. Defaults to 500. |
| 18 | + */ |
| 19 | + Integer getLimit(); |
| 20 | + |
| 21 | + /** |
| 22 | + * Returns the timeout for the call. |
| 23 | + * @return the current setting. Defaults to 30 seconds. |
| 24 | + */ |
| 25 | + Integer getTimeoutSeconds(); |
| 26 | + |
| 27 | + /** |
| 28 | + * Returns a selector to limit results to those with matching fields. |
| 29 | + * @return the option, if specified. Defaults to null, indicating no record filtering. |
| 30 | + */ |
| 31 | + String getFieldSelector(); |
| 32 | + |
| 33 | + /** |
| 34 | + * Returns a selector to limit results to those with matching labels. |
| 35 | + * @return the option, if specified. Defaults to null, indicating no record filtering. |
| 36 | + */ |
| 37 | + String getLabelSelector(); |
| 38 | + |
| 39 | + /** |
| 40 | + * Returns the 'pretty-print' option to be sent. If 'true', then the output is pretty printed. |
| 41 | + * @return the option, if specified. Defaults to null. |
| 42 | + */ |
| 43 | + String getPretty(); |
| 44 | + |
| 45 | + /** |
| 46 | + * On a watch call: when specified, shows changes that occur after that particular version of a resource. |
| 47 | + * Defaults to changes from the beginning of history. |
| 48 | + * On a list call: when specified, requests values at least as recent as the specified value. |
| 49 | + * Defaults to returning the result from remote storage based on quorum-read flag; |
| 50 | + * - if it's 0, then we simply return what we currently have in cache, no guarantee; |
| 51 | + * - if set to non zero, then the result is at least as fresh as given version. |
| 52 | + * @return the current setting. Defaults to null. |
| 53 | + */ |
| 54 | + String getResourceVersion(); |
| 55 | + |
| 56 | + /** |
| 57 | + * Returns a listener for responses received, to specify on calls. |
| 58 | + * @return the set listener. Defaults to null. |
| 59 | + */ |
| 60 | + ProgressResponseBody.ProgressListener getProgressListener(); |
| 61 | + |
| 62 | + /** |
| 63 | + * Returns a listener for requests sent, to specify on calls. |
| 64 | + * @return the set listener. Defaults to null. |
| 65 | + */ |
| 66 | + ProgressRequestBody.ProgressRequestListener getProgressRequestListener(); |
91 | 67 | }
|
0 commit comments