From db195be8d8c079a48650eeabc9aa331d983ed610 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 16 Nov 2017 12:19:55 +0100 Subject: [PATCH] Polishing. Improve Javadoc. See gh-177. --- .../vault/core/ReactiveVaultOperations.java | 20 ++++++++-------- .../vault/core/VaultOperations.java | 24 ++++++++++++++----- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/ReactiveVaultOperations.java b/spring-vault-core/src/main/java/org/springframework/vault/core/ReactiveVaultOperations.java index d0e4e04d..8a836fb5 100644 --- a/spring-vault-core/src/main/java/org/springframework/vault/core/ReactiveVaultOperations.java +++ b/spring-vault-core/src/main/java/org/springframework/vault/core/ReactiveVaultOperations.java @@ -49,8 +49,8 @@ import org.springframework.web.reactive.function.client.WebClientException; public interface ReactiveVaultOperations { /** - * Read from a secret backend. Reading data using this method is suitable for secret - * backends that do not require a request body. + * Read from a Vault path. Reading data using this method is suitable for API + * calls/secret backends that do not require a request body. * * @param path must not be {@literal null}. * @return the data. May be empty if the path does not exist. @@ -58,8 +58,8 @@ public interface ReactiveVaultOperations { Mono read(String path); /** - * Read from a secret backend. Reading data using this method is suitable for secret - * backends that do not require a request body. + * Read from a Vault path. Reading data using this method is suitable for API + * calls/secret backends that do not require a request body. * * @param path must not be {@literal null}. * @param responseType must not be {@literal null}. @@ -68,7 +68,7 @@ public interface ReactiveVaultOperations { Mono> read(String path, Class responseType); /** - * Enumerate keys from a secret backend. + * Enumerate keys from a Vault path. * * @param path must not be {@literal null}. * @return the data. May be empty if the path does not exist. @@ -76,26 +76,26 @@ public interface ReactiveVaultOperations { Flux list(String path); /** - * Write to a secret backend. + * Write to a Vault path. * * @param path must not be {@literal null}. - * @return the configuration data. May be empty but never {@literal null}. + * @return the response. May be empty if the response has no body. */ default Mono write(String path) { return write(path, null); } /** - * Write to a secret backend. + * Write to a Vault path. * * @param path must not be {@literal null}. * @param body the body, may be {@literal null} if absent. - * @return the configuration data. May be empty but never {@literal null}. + * @return the response. May be empty if the response has no body. */ Mono write(String path, @Nullable Object body); /** - * Delete a path in the secret backend. + * Delete a path. * * @param path must not be {@literal null}. */ diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/VaultOperations.java b/spring-vault-core/src/main/java/org/springframework/vault/core/VaultOperations.java index 8bcb4427..3e15163d 100644 --- a/spring-vault-core/src/main/java/org/springframework/vault/core/VaultOperations.java +++ b/spring-vault-core/src/main/java/org/springframework/vault/core/VaultOperations.java @@ -82,8 +82,8 @@ public interface VaultOperations { VaultPkiOperations opsForPki(String path); /** - * Read from a secret backend. Reading data using this method is suitable for secret - * backends that do not require a request body. + * Read from a Vault path. Reading data using this method is suitable for API + * calls/secret backends that do not require a request body. * * @param path must not be {@literal null}. * @return the data. May be {@literal null} if the path does not exist. @@ -103,7 +103,7 @@ public interface VaultOperations { VaultResponseSupport read(String path, Class responseType); /** - * Enumerate keys from a secret backend. + * Enumerate keys from a Vault path. * * @param path must not be {@literal null}. * @return the data. May be {@literal null} if the path does not exist. @@ -112,17 +112,29 @@ public interface VaultOperations { List list(String path); /** - * Write to a secret backend. + * Write to a Vault path. + * + * @param path must not be {@literal null}. + * @return the response, may be {@literal null}. + * @since 2.0 + */ + @Nullable + default VaultResponse write(String path) { + return write(path, null); + } + + /** + * Write to a Vault path. * * @param path must not be {@literal null}. * @param body the body, may be {@literal null} if absent. - * @return the configuration data. May be {@literal null}. + * @return the response, may be {@literal null}. */ @Nullable VaultResponse write(String path, @Nullable Object body); /** - * Delete a path in the secret backend. + * Delete a path. * * @param path must not be {@literal null}. */