@@ -71,6 +71,21 @@ final class MemcachedConfiguration {
7171 */
7272 private TimeUnit timeUnit ;
7373
74+ /**
75+ * The flag to enable SASL Connection
76+ */
77+ private boolean usingSASL ;
78+
79+ /**
80+ * The Memcached SASL username
81+ */
82+ private String username ;
83+
84+ /**
85+ * The Memcached SASL password
86+ */
87+ private String password ;
88+
7489 /**
7590 * @return the keyPrefix
7691 */
@@ -183,12 +198,42 @@ public void setTimeUnit(TimeUnit timeUnit) {
183198 this .timeUnit = timeUnit ;
184199 }
185200
201+ /**
202+ * @return the usingSASL
203+ */
204+ public boolean isUsingSASL () { return usingSASL ; }
205+
206+ /**
207+ * @param usingSASL the usingSASL to set
208+ */
209+ public void setUsingSASL (boolean usingSASL ) { this .usingSASL = usingSASL ; }
210+
211+ /**
212+ * @return the username
213+ */
214+ public String getUsername () { return username ; }
215+
216+ /**
217+ * @param username the username to set
218+ */
219+ public void setUsername (String username ) { this .username = username ; }
220+
221+ /**
222+ * @return the password
223+ */
224+ public String getPassword () { return password ; }
225+
226+ /**
227+ * @param password the password to set
228+ */
229+ public void setPassword (String password ) { this .password = password ; }
230+
186231 /**
187232 * {@inheritDoc}
188233 */
189234 @ Override
190235 public int hashCode () {
191- return hash (1 , 31 , addresses , compressionEnabled , connectionFactory , expiration , keyPrefix , timeUnit , timeout , usingAsyncGet );
236+ return hash (1 , 31 , addresses , compressionEnabled , connectionFactory , expiration , keyPrefix , timeUnit , timeout , usingAsyncGet , usingSASL , username , password );
192237 }
193238
194239 /**
@@ -227,7 +272,10 @@ && eq(expiration, other.expiration)
227272 && eq (keyPrefix , other .keyPrefix )
228273 && eq (timeUnit , other .timeUnit )
229274 && eq (timeout , other .timeout )
230- && eq (usingAsyncGet , other .usingAsyncGet );
275+ && eq (usingAsyncGet , other .usingAsyncGet )
276+ && eq (usingSASL , other .usingSASL )
277+ && eq (username , other .username )
278+ && eq (password , other .password );
231279 }
232280
233281 /**
@@ -246,8 +294,8 @@ private static <O> boolean eq( O o1, O o2 ) {
246294 */
247295 @ Override
248296 public String toString () {
249- return format ( "MemcachedConfiguration [addresses=%s, compressionEnabled=%s, connectionFactory=%s, , expiration=%s, keyPrefix=%s, timeUnit=%s, timeout=%s, usingAsyncGet=%s]" ,
250- addresses , compressionEnabled , connectionFactory , expiration , keyPrefix , timeUnit , timeout , usingAsyncGet );
297+ return format ( "MemcachedConfiguration [addresses=%s, compressionEnabled=%s, connectionFactory=%s, , expiration=%s, keyPrefix=%s, timeUnit=%s, timeout=%s, usingAsyncGet=%s, usingSASL=%s, username=%s, password=%s ]" ,
298+ addresses , compressionEnabled , connectionFactory , expiration , keyPrefix , timeUnit , timeout , usingAsyncGet , usingSASL , username , password );
251299 }
252300
253301}
0 commit comments