kenhuuu commented on code in PR #3466:
URL: https://github.com/apache/tinkerpop/pull/3466#discussion_r3453604310
##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java:
##########
@@ -793,20 +964,102 @@ public Builder port(final int port) {
return this;
}
+ /**
+ * Configures the endpoint from a single URL string. The URL is parsed
and applied to the builder as follows:
+ * the scheme selects SSL ({@code https} enables SSL, {@code http}
disables it; other or absent schemes leave
+ * the current SSL setting unchanged), the host is added as a contact
point, an explicit port is applied via
+ * {@link #port(int)}, and a non-empty path is applied via {@link
#path(String)}. This is a convenience for the
+ * common single-host case; use {@link #addContactPoint(String)} /
{@link #addContactPoints(String...)} along
+ * with {@link #port(int)} and {@link #path(String)} for multi-host
configurations.
+ *
+ * @param url a full URL such as {@code
https://gremlin.example.com:8182/gremlin}
+ * @throws IllegalArgumentException if the URL cannot be parsed or has
no host
+ */
+ public Builder url(final String url) {
Review Comment:
Potentially confusing. Right now, the Cluster supports multiple hosts but
they must all share a single port. This method is already documented as being a
convenience for a single endpoint, but I think you should actually throw if a
contact point already exists to prevent misuse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]