package io.quarkus.reactive.datasource.runtime;

import java.util.Optional;
import java.util.OptionalInt;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.quarkus.vertx.core.runtime.config.JksConfiguration;
import io.quarkus.vertx.core.runtime.config.PemKeyCertConfiguration;
import io.quarkus.vertx.core.runtime.config.PemTrustCertConfiguration;
import io.quarkus.vertx.core.runtime.config.PfxConfiguration;

/**
 * For now, the reactive extensions only support a default datasource.
 */
@ConfigRoot(name = "datasource.reactive", phase = ConfigPhase.RUN_TIME)
public class DataSourceReactiveRuntimeConfig {

    /**
     * The datasource URL.
     */
    @ConfigItem
    public Optional<String> url;

    /**
     * The datasource pool maximum size.
     */
    @ConfigItem
    public OptionalInt maxSize;

    /**
     * Whether all server certificates should be trusted.
     */
    @ConfigItem(defaultValue = "false")
    public boolean trustAll;

    /**
     * Trust configuration in the PEM format.
     * <p>
     * When enabled, {@link #trustCertificateJks} and {@link #trustCertificatePfx} must be disabled.
     */
    @ConfigItem
    public PemTrustCertConfiguration trustCertificatePem;

    /**
     * Trust configuration in the JKS format.
     * <p>
     * When enabled, {@link #trustCertificatePem} and {@link #trustCertificatePfx} must be disabled.
     */
    @ConfigItem
    public JksConfiguration trustCertificateJks;

    /**
     * Trust configuration in the PFX format.
     * <p>
     * When enabled, {@link #trustCertificateJks} and {@link #trustCertificatePem} must be disabled.
     */
    @ConfigItem
    public PfxConfiguration trustCertificatePfx;

    /**
     * Key/cert configuration in the PEM format.
     * <p>
     * When enabled, {@link #keyCertificateJks} and {@link #keyCertificatePfx} must be disabled.
     */
    @ConfigItem
    public PemKeyCertConfiguration keyCertificatePem;

    /**
     * Key/cert configuration in the JKS format.
     * <p>
     * When enabled, {@link #keyCertificatePem} and {@link #keyCertificatePfx} must be disabled.
     */
    @ConfigItem
    public JksConfiguration keyCertificateJks;

    /**
     * Key/cert configuration in the PFX format.
     * <p>
     * When enabled, {@link #keyCertificateJks} and {@link #keyCertificatePem} must be disabled.
     */
    @ConfigItem
    public PfxConfiguration keyCertificatePfx;
}

@@ -1142,36 +1142,37 @@
  enabled, %7B@
-link
+code
  #trust
-C
+-c
 ertificateJk
@@ -1161,33 +1161,34 @@
 rust-certificate
-J
+-j
 ks%7D and %7B@link #
@@ -1177,36 +1177,37 @@
 -jks%7D and %7B@
-link
+code
  #trust
-C
+-c
 ertificatePf
@@ -1196,33 +1196,34 @@
 rust-certificate
-P
+-p
 fx%7D must be disa
@@ -1395,36 +1395,37 @@
  enabled, %7B@
-link
+code
  #trust
-C
+-c
 ertificatePe
@@ -1414,33 +1414,34 @@
 rust-certificate
-P
+-p
 em%7D and %7B@link #
@@ -1430,36 +1430,37 @@
 -pem%7D and %7B@
-link
+code
  #trust
-C
+-c
 ertificatePf
@@ -1449,33 +1449,34 @@
 rust-certificate
-P
+-p
 fx%7D must be disa
@@ -1643,28 +1643,29 @@
 bled, %7B@
-link
+code
  #trust
-C
+-c
 ertifica
@@ -1658,33 +1658,34 @@
 rust-certificate
-J
+-j
 ks%7D and %7B@link #
@@ -1682,20 +1682,21 @@
 d %7B@
-link
+code
  #trust
-C
+-c
 erti
@@ -1693,33 +1693,34 @@
 rust-certificate
-P
+-p
 em%7D must be disa
@@ -1886,34 +1886,34 @@
  enabled, %7B@
-link #keyC
+code key-c
 ertificateJk
@@ -1902,33 +1902,34 @@
  key-certificate
-J
+-j
 ks%7D and %7B@link #
@@ -1918,34 +1918,35 @@
 -jks%7D and %7B@
-link
+code
  #key
-C
+-c
 ertificatePf
@@ -1935,33 +1935,34 @@
 #key-certificate
-P
+-p
 fx%7D must be disa
@@ -2133,34 +2133,35 @@
  enabled, %7B@
-link
+code
  #key
-C
+-c
 ertificatePe
@@ -2154,25 +2154,26 @@
 -certificate
-P
+-p
 em%7D and %7B@li
@@ -2166,34 +2166,35 @@
 -pem%7D and %7B@
-link
+code
  #key
-C
+-c
 ertificatePf
@@ -2191,17 +2191,18 @@
 tificate
-P
+-p
 fx%7D must
@@ -2378,26 +2378,26 @@
 bled, %7B@
-link #keyC
+code key-c
 ertifica
@@ -2398,17 +2398,18 @@
 tificate
-J
+-j
 ks%7D and 
@@ -2414,18 +2414,19 @@
 d %7B@
-link
+code
  #key
-C
+-c
 erti
@@ -2431,17 +2431,18 @@
 tificate
-P
+-p
 em%7D must

Update Javadoc