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.
22// Licensed under the Universal Permissive License v 1.0 as shown at
33// http://oss.oracle.com/licenses/upl.
44
77import java .io .IOException ;
88import java .util .Map ;
99import 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 ;
1013
1114public interface TuningParameters extends Map <String , String > {
1215
@@ -47,6 +50,55 @@ public MainTuning(
4750 this .initialShortDelay = initialShortDelay ;
4851 this .eventualLongDelay = eventualLongDelay ;
4952 }
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+ }
50102 }
51103
52104 public static class CallBuilderTuning {
@@ -59,13 +111,77 @@ public CallBuilderTuning(int callRequestLimit, int callMaxRetryCount, int callTi
59111 this .callMaxRetryCount = callMaxRetryCount ;
60112 this .callTimeoutSeconds = callTimeoutSeconds ;
61113 }
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+ }
62148 }
63149
64150 public static class WatchTuning {
65151 public final int watchLifetime ;
152+ public final int watchMinimumDelay ;
66153
67- public WatchTuning (int watchLifetime ) {
154+ public WatchTuning (int watchLifetime , int watchMinimumDelay ) {
68155 this .watchLifetime = watchLifetime ;
156+ this .watchMinimumDelay = watchMinimumDelay ;
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 ();
69185 }
70186 }
71187
@@ -91,6 +207,49 @@ public PodTuning(
91207 this .livenessProbeTimeoutSeconds = livenessProbeTimeoutSeconds ;
92208 this .livenessProbePeriodSeconds = livenessProbePeriodSeconds ;
93209 }
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+ }
94253 }
95254
96255 public MainTuning getMainTuning ();
0 commit comments