comparison src/main/java/org/monetdb/mcl/net/Target.java @ 903:778959b2e0a4

Send ClientInfo on startup Configurable through the client_info=bool, client_application=NAME, client_remark=MESSAGE properties.
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Fri, 14 Jun 2024 15:57:49 +0200 (11 months ago)
parents b80758ef25db
children a52bc2dcdb8c
comparison
equal deleted inserted replaced
902:65d42db0c831 903:778959b2e0a4
44 private boolean debug = false; 44 private boolean debug = false;
45 private String logfile = ""; 45 private String logfile = "";
46 private int soTimeout = 0; 46 private int soTimeout = 0;
47 private boolean treatClobAsVarchar = true; 47 private boolean treatClobAsVarchar = true;
48 private boolean treatBlobAsBinary = true; 48 private boolean treatBlobAsBinary = true;
49 private boolean clientInfo = true;
50 private String clientApplication = "";
51 private String clientRemark = "";
49 private boolean userWasSet = false; 52 private boolean userWasSet = false;
50 private boolean passwordWasSet = false; 53 private boolean passwordWasSet = false;
51 private Validated validated = null; 54 private Validated validated = null;
52 55
53 public Target() { 56 public Target() {
199 case CLOB_AS_VARCHAR: 202 case CLOB_AS_VARCHAR:
200 setTreatClobAsVarchar((boolean) value); 203 setTreatClobAsVarchar((boolean) value);
201 break; 204 break;
202 case BLOB_AS_BINARY: 205 case BLOB_AS_BINARY:
203 setTreatBlobAsBinary((boolean) value); 206 setTreatBlobAsBinary((boolean) value);
207 break;
208 case CLIENT_INFO:
209 setClientInfo((boolean) value);
210 break;
211 case CLIENT_APPLICATION:
212 setClientApplication((String) value);
213 break;
214 case CLIENT_REMARK:
215 setClientRemark((String) value);
204 break; 216 break;
205 217
206 default: 218 default:
207 throw new IllegalStateException("unreachable -- missing case: " + parm.name); 219 throw new IllegalStateException("unreachable -- missing case: " + parm.name);
208 } 220 }
267 return soTimeout; 279 return soTimeout;
268 case CLOB_AS_VARCHAR: 280 case CLOB_AS_VARCHAR:
269 return treatClobAsVarchar; 281 return treatClobAsVarchar;
270 case BLOB_AS_BINARY: 282 case BLOB_AS_BINARY:
271 return treatBlobAsBinary; 283 return treatBlobAsBinary;
284 case CLIENT_INFO:
285 return clientInfo;
286 case CLIENT_APPLICATION:
287 return clientApplication;
288 case CLIENT_REMARK:
289 return clientRemark;
272 default: 290 default:
273 throw new IllegalStateException("unreachable -- missing case"); 291 throw new IllegalStateException("unreachable -- missing case");
274 } 292 }
275 } 293 }
276 294
506 } 524 }
507 525
508 public void setTreatBlobAsBinary(boolean treatBlobAsBinary) { 526 public void setTreatBlobAsBinary(boolean treatBlobAsBinary) {
509 this.treatBlobAsBinary = treatBlobAsBinary; 527 this.treatBlobAsBinary = treatBlobAsBinary;
510 validated = null; 528 validated = null;
529 }
530
531 public boolean isClientInfo() {
532 return clientInfo;
533 }
534
535 public void setClientInfo(boolean clientInfo) {
536 this.clientInfo = clientInfo;
537 }
538
539 public String getClientApplication() {
540 return clientApplication;
541 }
542
543 public void setClientApplication(String clientApplication) {
544 this.clientApplication = clientApplication;
545 }
546
547 public String getClientRemark() {
548 return clientRemark;
549 }
550
551 public void setClientRemark(String clientRemark) {
552 this.clientRemark = clientRemark;
511 } 553 }
512 554
513 public Validated validate() throws ValidationError { 555 public Validated validate() throws ValidationError {
514 if (validated == null) 556 if (validated == null)
515 validated = new Validated(); 557 validated = new Validated();