summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-06-14 14:55:16 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-06-14 14:55:22 +0200
commit5f2365e439a4e15b901397a1fcd2c0e79843fd43 (patch)
tree32c1123d72904f297c0c6e3fb96834cf11017251 /vespa-feed-client
parent7a620f9c8f8c1895c28707f5bc633330fa580b1a (diff)
Add Javadoc
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/DocumentId.java2
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java2
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java26
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedException.java2
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/JsonParseException.java2
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/OperationParameters.java2
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/Result.java2
7 files changed, 38 insertions, 0 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/DocumentId.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/DocumentId.java
index 21513a5dac2..39fc9fb28e0 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/DocumentId.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/DocumentId.java
@@ -8,6 +8,8 @@ import java.util.OptionalLong;
import static java.util.Objects.requireNonNull;
/**
+ * Represents a Vespa document id
+ *
* @author jonmv
*/
public class DocumentId {
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java
index 39d343515fe..250809a48b9 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClient.java
@@ -5,6 +5,8 @@ import java.io.Closeable;
import java.util.concurrent.CompletableFuture;
/**
+ * Asynchronous feed client accepting document operations as JSON
+ *
* @author bjorncs
* @author jonmv
*/
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
index df1f3bcd54c..e0418836c80 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedClientBuilder.java
@@ -45,8 +45,10 @@ public class FeedClientBuilder {
PrivateKey privateKey;
Collection<X509Certificate> caCertificates;
+ /** Creates a builder for a single container endpoint **/
public static FeedClientBuilder create(URI endpoint) { return new FeedClientBuilder(Collections.singletonList(endpoint)); }
+ /** Creates a builder for multiple container endpoints **/
public static FeedClientBuilder create(List<URI> endpoints) { return new FeedClientBuilder(endpoints); }
private FeedClientBuilder(List<URI> endpoints) {
@@ -86,61 +88,85 @@ public class FeedClientBuilder {
return this;
}
+ /** Sets {@link SSLContext} instance. */
public FeedClientBuilder setSslContext(SSLContext context) {
this.sslContext = requireNonNull(context);
return this;
}
+ /** Sets {@link HostnameVerifier} instance (e.g for disabling default SSL hostname verification). */
public FeedClientBuilder setHostnameVerifier(HostnameVerifier verifier) {
this.hostnameVerifier = requireNonNull(verifier);
return this;
}
+ /** Adds HTTP request header to all client requests. */
public FeedClientBuilder addRequestHeader(String name, String value) {
return addRequestHeader(name, () -> requireNonNull(value));
}
+ /**
+ * Adds HTTP request header to all client requests. Value {@link Supplier} is invoked for each HTTP request,
+ * i.e. value can be dynamically updated during a feed.
+ */
public FeedClientBuilder addRequestHeader(String name, Supplier<String> valueSupplier) {
this.requestHeaders.put(requireNonNull(name), requireNonNull(valueSupplier));
return this;
}
+ /**
+ * Overrides default retry strategy.
+ * @see FeedClient.RetryStrategy
+ */
public FeedClientBuilder setRetryStrategy(FeedClient.RetryStrategy strategy) {
this.retryStrategy = requireNonNull(strategy);
return this;
}
+ /**
+ * Overrides default circuit breaker.
+ * @see FeedClient.CircuitBreaker
+ */
public FeedClientBuilder setCircuitBreaker(FeedClient.CircuitBreaker breaker) {
this.circuitBreaker = requireNonNull(breaker);
return this;
}
+ /** Sets path to client SSL certificate/key PEM files */
public FeedClientBuilder setCertificate(Path certificatePemFile, Path privateKeyPemFile) {
this.certificateFile = certificatePemFile;
this.privateKeyFile = privateKeyPemFile;
return this;
}
+ /** Sets client SSL certificates/key */
public FeedClientBuilder setCertificate(Collection<X509Certificate> certificate, PrivateKey privateKey) {
this.certificate = certificate;
this.privateKey = privateKey;
return this;
}
+ /** Sets client SSL certificate/key */
public FeedClientBuilder setCertificate(X509Certificate certificate, PrivateKey privateKey) {
return setCertificate(Collections.singletonList(certificate), privateKey);
}
+ /**
+ * Overrides JVM default SSL truststore
+ * @param caCertificatesFile Path to PEM encoded file containing trusted certificates
+ */
public FeedClientBuilder setCaCertificatesFile(Path caCertificatesFile) {
this.caCertificatesFile = caCertificatesFile;
return this;
}
+ /** Overrides JVM default SSL truststore */
public FeedClientBuilder setCaCertificates(Collection<X509Certificate> caCertificates) {
this.caCertificates = caCertificates;
return this;
}
+ /** Constructs instance of {@link ai.vespa.feed.client.FeedClient} from builder configuration */
public FeedClient build() {
try {
validateConfiguration();
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedException.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedException.java
index 25068818396..e1c6c733e9c 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedException.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/FeedException.java
@@ -2,6 +2,8 @@
package ai.vespa.feed.client;
/**
+ * Signals that an error occurred during feeding
+ *
* @author bjorncs
*/
public class FeedException extends RuntimeException {
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/JsonParseException.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/JsonParseException.java
index 785ffd8eb4c..8edf74ec275 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/JsonParseException.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/JsonParseException.java
@@ -2,6 +2,8 @@
package ai.vespa.feed.client;
/**
+ * Signals that supplied JSON is invalid
+ *
* @author bjorncs
*/
public class JsonParseException extends FeedException {
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/OperationParameters.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/OperationParameters.java
index 22546f89ccb..8c20a37d224 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/OperationParameters.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/OperationParameters.java
@@ -7,6 +7,8 @@ import java.util.Optional;
import java.util.OptionalInt;
/**
+ * Per-operation feed parameters
+ *
* @author bjorncs
* @author jonmv
*/
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/Result.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/Result.java
index 31a6cf6e893..b29d65e193b 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/Result.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/Result.java
@@ -4,6 +4,8 @@ package ai.vespa.feed.client;
import java.util.Optional;
/**
+ * Result for a document operation
+ *
* @author bjorncs
* @author jonmv
*/