Mercurial > hg > monetdb-java
diff 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 (10 months ago) |
parents | b80758ef25db |
children | a52bc2dcdb8c |
line wrap: on
line diff
--- a/src/main/java/org/monetdb/mcl/net/Target.java +++ b/src/main/java/org/monetdb/mcl/net/Target.java @@ -46,6 +46,9 @@ public class Target { private int soTimeout = 0; private boolean treatClobAsVarchar = true; private boolean treatBlobAsBinary = true; + private boolean clientInfo = true; + private String clientApplication = ""; + private String clientRemark = ""; private boolean userWasSet = false; private boolean passwordWasSet = false; private Validated validated = null; @@ -202,6 +205,15 @@ public class Target { case BLOB_AS_BINARY: setTreatBlobAsBinary((boolean) value); break; + case CLIENT_INFO: + setClientInfo((boolean) value); + break; + case CLIENT_APPLICATION: + setClientApplication((String) value); + break; + case CLIENT_REMARK: + setClientRemark((String) value); + break; default: throw new IllegalStateException("unreachable -- missing case: " + parm.name); @@ -269,6 +281,12 @@ public class Target { return treatClobAsVarchar; case BLOB_AS_BINARY: return treatBlobAsBinary; + case CLIENT_INFO: + return clientInfo; + case CLIENT_APPLICATION: + return clientApplication; + case CLIENT_REMARK: + return clientRemark; default: throw new IllegalStateException("unreachable -- missing case"); } @@ -510,6 +528,30 @@ public class Target { validated = null; } + public boolean isClientInfo() { + return clientInfo; + } + + public void setClientInfo(boolean clientInfo) { + this.clientInfo = clientInfo; + } + + public String getClientApplication() { + return clientApplication; + } + + public void setClientApplication(String clientApplication) { + this.clientApplication = clientApplication; + } + + public String getClientRemark() { + return clientRemark; + } + + public void setClientRemark(String clientRemark) { + this.clientRemark = clientRemark; + } + public Validated validate() throws ValidationError { if (validated == null) validated = new Validated();