@@ -59,6 +59,9 @@ public static Builder builder() {
59
59
private final NettyOptions nettyOptions ;
60
60
private final CodecRegistry codecRegistry ;
61
61
private final String defaultKeyspace ;
62
+ private final String applicationName ;
63
+ private final String applicationVersion ;
64
+ private final String clientId ;
62
65
63
66
private Configuration (
64
67
Policies policies ,
@@ -70,7 +73,10 @@ private Configuration(
70
73
ThreadingOptions threadingOptions ,
71
74
NettyOptions nettyOptions ,
72
75
CodecRegistry codecRegistry ,
73
- String defaultKeyspace ) {
76
+ String defaultKeyspace ,
77
+ String applicationName ,
78
+ String applicationVersion ,
79
+ String clientId ) {
74
80
this .policies = policies ;
75
81
this .protocolOptions = protocolOptions ;
76
82
this .poolingOptions = poolingOptions ;
@@ -81,6 +87,9 @@ private Configuration(
81
87
this .nettyOptions = nettyOptions ;
82
88
this .codecRegistry = codecRegistry ;
83
89
this .defaultKeyspace = defaultKeyspace ;
90
+ this .applicationName = applicationName ;
91
+ this .applicationVersion = applicationVersion ;
92
+ this .clientId = clientId ;
84
93
}
85
94
86
95
/**
@@ -99,7 +108,10 @@ protected Configuration(Configuration toCopy) {
99
108
toCopy .getThreadingOptions (),
100
109
toCopy .getNettyOptions (),
101
110
toCopy .getCodecRegistry (),
102
- toCopy .getDefaultKeyspace ());
111
+ toCopy .getDefaultKeyspace (),
112
+ toCopy .getApplicationName (),
113
+ toCopy .getApplicationVersion (),
114
+ toCopy .getClientId ());
103
115
}
104
116
105
117
void register (Cluster .Manager manager ) {
@@ -213,6 +225,19 @@ public NettyOptions getNettyOptions() {
213
225
public String getDefaultKeyspace () {
214
226
return defaultKeyspace ;
215
227
}
228
+
229
+ public String getApplicationName () {
230
+ return applicationName ;
231
+ }
232
+
233
+ public String getApplicationVersion () {
234
+ return applicationVersion ;
235
+ }
236
+
237
+ public String getClientId () {
238
+ return clientId ;
239
+ }
240
+
216
241
/**
217
242
* Returns the {@link CodecRegistry} instance for this configuration.
218
243
*
@@ -239,6 +264,42 @@ public static class Builder {
239
264
private NettyOptions nettyOptions ;
240
265
private CodecRegistry codecRegistry ;
241
266
private String defaultKeyspace ;
267
+ private String applicationName ;
268
+ private String applicationVersion ;
269
+ private String clientId ;
270
+
271
+ /**
272
+ * Sets application name, to be reported to server
273
+ *
274
+ * @param applicationName application name.
275
+ * @return this builder.
276
+ */
277
+ public Builder withApplicationName (String applicationName ) {
278
+ this .applicationName = applicationName ;
279
+ return this ;
280
+ }
281
+
282
+ /**
283
+ * Sets application version, to be reported to server
284
+ *
285
+ * @param applicationVersion application version.
286
+ * @return this builder.
287
+ */
288
+ public Builder withApplicationVersion (String applicationVersion ) {
289
+ this .applicationVersion = applicationVersion ;
290
+ return this ;
291
+ }
292
+
293
+ /**
294
+ * Sets client id, to be reported to server
295
+ *
296
+ * @param clientId application version.
297
+ * @return this builder.
298
+ */
299
+ public Builder withClientId (String clientId ) {
300
+ this .clientId = clientId ;
301
+ return this ;
302
+ }
242
303
243
304
/**
244
305
* Sets the policies for this cluster.
@@ -370,7 +431,10 @@ public Configuration build() {
370
431
threadingOptions != null ? threadingOptions : new ThreadingOptions (),
371
432
nettyOptions != null ? nettyOptions : NettyOptions .DEFAULT_INSTANCE ,
372
433
codecRegistry != null ? codecRegistry : CodecRegistry .DEFAULT_INSTANCE ,
373
- defaultKeyspace );
434
+ defaultKeyspace ,
435
+ applicationName ,
436
+ applicationVersion ,
437
+ clientId );
374
438
}
375
439
}
376
440
}
0 commit comments