From a36a40ff158d8e199957e812a787aaf7e9999e2b Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:42:01 +0100 Subject: [PATCH] docs: enhance configurations documentation Signed-off-by: Otavio Santana --- .../jnosql/communication/Configurations.java | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java index 7f8e8dbcf..c09db52dc 100644 --- a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java +++ b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java @@ -19,30 +19,63 @@ import java.util.function.Supplier; /** - * This enum contains all the commons configurations that might be used to the NoSQL databases. - * It implements {@link Supplier} which returns the property value on the arrangement. + * This enum contains common configurations that are frequently used for NoSQL databases. + * It provides a standardized way to retrieve configuration keys using the {@link Supplier} interface, + * which allows these properties to be fetched dynamically in different contexts. + * + *

Each constant in this enum represents a specific configuration option, such as connection details + * (user, password, host) or other database-related settings (like encryption and pagination behavior). + * By implementing {@link Supplier}, each enum constant can supply the associated property value directly + * via the {@link #get()} method.

+ * + *

Developers can reference these constants throughout the application to avoid hardcoding configuration + * keys and ensure consistent access to NoSQL database properties. This is particularly useful for managing + * complex or large-scale database configurations where multiple properties (e.g., hosts, pagination settings) + * are involved.

*/ public enum Configurations implements Supplier { + /** - * to set a user in a NoSQL database + * Configuration for setting the user in a NoSQL database. + *

This property is used to specify the username required for authenticating + * the connection to the NoSQL database.

+ *

Example: jakarta.nosql.user=admin

*/ USER("jakarta.nosql.user"), + /** - * to set a password in a database + * Configuration for setting the password in a NoSQL database. + *

This property is used in conjunction with the {@link #USER} configuration + * to authenticate the database connection by providing the user’s password.

+ *

Example: jakarta.nosql.password=secret

*/ PASSWORD("jakarta.nosql.password"), + /** - * the host configuration that might have more than one with a number as a suffix, - * such as jakarta.nosql.host-1=localhost, jakarta.nosql.host-2=host2 + * Host configuration for connecting to the NoSQL database. + *

This property allows setting multiple hosts by using a numbered suffix (e.g., host-1, host-2). + * This is useful for distributed databases or in cases where multiple instances or replicas + * of the database are running.

+ *

Example: jakarta.nosql.host-1=localhost, jakarta.nosql.host-2=remote-host

*/ HOST("jakarta.nosql.host"), + /** - * A configuration to set the encryption to settings property. + * Configuration to enable encryption settings for NoSQL database connections. + *

This property is used to configure encryption settings, which are critical + * for securing data in transit or at rest within the NoSQL database. It defines the encryption + * protocols or keys that should be applied.

+ *

Example: jakarta.nosql.settings.encryption=AES256

*/ ENCRYPTION("jakarta.nosql.settings.encryption"), /** - * A configuration to enable cursor pagination in a NoSQL database using multiple sorting. + * Configuration to enable cursor-based pagination with multiple sorting in NoSQL databases. + *

This property allows enabling cursor pagination with support for multiple sorting fields. + * By default, multiple sorting is disabled due to potential inconsistencies in NoSQL databases when + * sorting by multiple fields that contain duplicate values. Enabling this option allows users to + * explicitly manage multi-field sorting during cursor-based pagination.

+ *

To enable, set: org.eclipse.jnosql.pagination.cursor=true

*/ CURSOR_PAGINATION_MULTIPLE_SORTING("org.eclipse.jnosql.pagination.cursor");