1
- // Copyright 2017, 2018 , Oracle Corporation and/or its affiliates. All rights reserved.
1
+ // Copyright 2017, 2019 , Oracle Corporation and/or its affiliates. All rights reserved.
2
2
// Licensed under the Universal Permissive License v 1.0 as shown at
3
3
// http://oss.oracle.com/licenses/upl.
4
4
7
7
import java .io .IOException ;
8
8
import java .util .Map ;
9
9
import java .util .concurrent .ScheduledExecutorService ;
10
+ import org .apache .commons .lang3 .builder .EqualsBuilder ;
11
+ import org .apache .commons .lang3 .builder .HashCodeBuilder ;
12
+ import org .apache .commons .lang3 .builder .ToStringBuilder ;
10
13
11
14
public interface TuningParameters extends Map <String , String > {
12
15
@@ -47,6 +50,55 @@ public MainTuning(
47
50
this .initialShortDelay = initialShortDelay ;
48
51
this .eventualLongDelay = eventualLongDelay ;
49
52
}
53
+
54
+ @ Override
55
+ public String toString () {
56
+ return new ToStringBuilder (this )
57
+ .append ("domainPresenceFailureRetrySeconds" , domainPresenceFailureRetrySeconds )
58
+ .append ("domainPresenceFailureRetryMaxCount" , domainPresenceFailureRetryMaxCount )
59
+ .append ("domainPresenceRecheckIntervalSeconds" , domainPresenceRecheckIntervalSeconds )
60
+ .append ("targetNamespaceRecheckIntervalSeconds" , targetNamespaceRecheckIntervalSeconds )
61
+ .append ("statusUpdateTimeoutSeconds" , statusUpdateTimeoutSeconds )
62
+ .append ("unchangedCountToDelayStatusRecheck" , unchangedCountToDelayStatusRecheck )
63
+ .append ("initialShortDelay" , initialShortDelay )
64
+ .append ("eventualLongDelay" , eventualLongDelay )
65
+ .toString ();
66
+ }
67
+
68
+ @ Override
69
+ public int hashCode () {
70
+ return new HashCodeBuilder ()
71
+ .append (domainPresenceFailureRetrySeconds )
72
+ .append (domainPresenceFailureRetryMaxCount )
73
+ .append (domainPresenceRecheckIntervalSeconds )
74
+ .append (targetNamespaceRecheckIntervalSeconds )
75
+ .append (statusUpdateTimeoutSeconds )
76
+ .append (unchangedCountToDelayStatusRecheck )
77
+ .append (initialShortDelay )
78
+ .append (eventualLongDelay )
79
+ .toHashCode ();
80
+ }
81
+
82
+ @ Override
83
+ public boolean equals (Object o ) {
84
+ if (o == null ) {
85
+ return false ;
86
+ }
87
+ if (!(o instanceof MainTuning )) {
88
+ return false ;
89
+ }
90
+ MainTuning mt = (MainTuning ) o ;
91
+ return new EqualsBuilder ()
92
+ .append (domainPresenceFailureRetrySeconds , mt .domainPresenceFailureRetrySeconds )
93
+ .append (domainPresenceFailureRetryMaxCount , mt .domainPresenceFailureRetryMaxCount )
94
+ .append (domainPresenceRecheckIntervalSeconds , mt .domainPresenceRecheckIntervalSeconds )
95
+ .append (targetNamespaceRecheckIntervalSeconds , mt .targetNamespaceRecheckIntervalSeconds )
96
+ .append (statusUpdateTimeoutSeconds , mt .statusUpdateTimeoutSeconds )
97
+ .append (unchangedCountToDelayStatusRecheck , mt .unchangedCountToDelayStatusRecheck )
98
+ .append (initialShortDelay , mt .initialShortDelay )
99
+ .append (eventualLongDelay , mt .eventualLongDelay )
100
+ .isEquals ();
101
+ }
50
102
}
51
103
52
104
public static class CallBuilderTuning {
@@ -59,6 +111,40 @@ public CallBuilderTuning(int callRequestLimit, int callMaxRetryCount, int callTi
59
111
this .callMaxRetryCount = callMaxRetryCount ;
60
112
this .callTimeoutSeconds = callTimeoutSeconds ;
61
113
}
114
+
115
+ @ Override
116
+ public String toString () {
117
+ return new ToStringBuilder (this )
118
+ .append ("callRequestLimit" , callRequestLimit )
119
+ .append ("callMaxRetryCount" , callMaxRetryCount )
120
+ .append ("callTimeoutSeconds" , callTimeoutSeconds )
121
+ .toString ();
122
+ }
123
+
124
+ @ Override
125
+ public int hashCode () {
126
+ return new HashCodeBuilder ()
127
+ .append (callRequestLimit )
128
+ .append (callMaxRetryCount )
129
+ .append (callTimeoutSeconds )
130
+ .toHashCode ();
131
+ }
132
+
133
+ @ Override
134
+ public boolean equals (Object o ) {
135
+ if (o == null ) {
136
+ return false ;
137
+ }
138
+ if (!(o instanceof CallBuilderTuning )) {
139
+ return false ;
140
+ }
141
+ CallBuilderTuning cbt = (CallBuilderTuning ) o ;
142
+ return new EqualsBuilder ()
143
+ .append (callRequestLimit , cbt .callRequestLimit )
144
+ .append (callMaxRetryCount , cbt .callMaxRetryCount )
145
+ .append (callTimeoutSeconds , cbt .callTimeoutSeconds )
146
+ .isEquals ();
147
+ }
62
148
}
63
149
64
150
public static class WatchTuning {
@@ -69,6 +155,34 @@ public WatchTuning(int watchLifetime, int watchMinimumDelay) {
69
155
this .watchLifetime = watchLifetime ;
70
156
this .watchMinimumDelay = watchMinimumDelay ;
71
157
}
158
+
159
+ @ Override
160
+ public String toString () {
161
+ return new ToStringBuilder (this )
162
+ .append ("watchLifetime" , watchLifetime )
163
+ .append ("watchMinimumDelay" , watchMinimumDelay )
164
+ .toString ();
165
+ }
166
+
167
+ @ Override
168
+ public int hashCode () {
169
+ return new HashCodeBuilder ().append (watchLifetime ).append (watchMinimumDelay ).toHashCode ();
170
+ }
171
+
172
+ @ Override
173
+ public boolean equals (Object o ) {
174
+ if (o == null ) {
175
+ return false ;
176
+ }
177
+ if (!(o instanceof WatchTuning )) {
178
+ return false ;
179
+ }
180
+ WatchTuning wt = (WatchTuning ) o ;
181
+ return new EqualsBuilder ()
182
+ .append (watchLifetime , wt .watchLifetime )
183
+ .append (watchMinimumDelay , wt .watchMinimumDelay )
184
+ .isEquals ();
185
+ }
72
186
}
73
187
74
188
public static class PodTuning {
@@ -93,6 +207,49 @@ public PodTuning(
93
207
this .livenessProbeTimeoutSeconds = livenessProbeTimeoutSeconds ;
94
208
this .livenessProbePeriodSeconds = livenessProbePeriodSeconds ;
95
209
}
210
+
211
+ @ Override
212
+ public String toString () {
213
+ return new ToStringBuilder (this )
214
+ .append ("readinessProbeInitialDelaySeconds" , readinessProbeInitialDelaySeconds )
215
+ .append ("readinessProbeTimeoutSeconds" , readinessProbeTimeoutSeconds )
216
+ .append ("readinessProbePeriodSeconds" , readinessProbePeriodSeconds )
217
+ .append ("livenessProbeInitialDelaySeconds" , livenessProbeInitialDelaySeconds )
218
+ .append ("livenessProbeTimeoutSeconds" , livenessProbeTimeoutSeconds )
219
+ .append ("livenessProbePeriodSeconds" , livenessProbePeriodSeconds )
220
+ .toString ();
221
+ }
222
+
223
+ @ Override
224
+ public int hashCode () {
225
+ return new HashCodeBuilder ()
226
+ .append (readinessProbeInitialDelaySeconds )
227
+ .append (readinessProbeTimeoutSeconds )
228
+ .append (readinessProbePeriodSeconds )
229
+ .append (livenessProbeInitialDelaySeconds )
230
+ .append (livenessProbeTimeoutSeconds )
231
+ .append (livenessProbePeriodSeconds )
232
+ .toHashCode ();
233
+ }
234
+
235
+ @ Override
236
+ public boolean equals (Object o ) {
237
+ if (o == null ) {
238
+ return false ;
239
+ }
240
+ if (!(o instanceof PodTuning )) {
241
+ return false ;
242
+ }
243
+ PodTuning pt = (PodTuning ) o ;
244
+ return new EqualsBuilder ()
245
+ .append (readinessProbeInitialDelaySeconds , pt .readinessProbeInitialDelaySeconds )
246
+ .append (readinessProbeTimeoutSeconds , pt .readinessProbeTimeoutSeconds )
247
+ .append (readinessProbePeriodSeconds , pt .readinessProbePeriodSeconds )
248
+ .append (livenessProbeInitialDelaySeconds , pt .livenessProbeInitialDelaySeconds )
249
+ .append (livenessProbeTimeoutSeconds , pt .livenessProbeTimeoutSeconds )
250
+ .append (livenessProbePeriodSeconds , pt .livenessProbePeriodSeconds )
251
+ .isEquals ();
252
+ }
96
253
}
97
254
98
255
public MainTuning getMainTuning ();
0 commit comments