You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2025/06/13 09:45:54 UTC

(causeway) branch v4 updated: CAUSEWAY-3892: work on deprecations (4)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/v4 by this push:
     new 2e656191d9c CAUSEWAY-3892: work on deprecations (4)
2e656191d9c is described below

commit 2e656191d9c9261a0702c26687983e89e3dc3c78
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jun 13 11:45:49 2025 +0200

    CAUSEWAY-3892: work on deprecations (4)
    
    - recovers javadoc from prev. commit
---
 .../core/config/CausewayModuleCoreConfig.java      |  9 ++-
 .../causeway/core/config/EmailConfiguration.java   | 84 ++++++++++++++++++++++
 2 files changed, 88 insertions(+), 5 deletions(-)

diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayModuleCoreConfig.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayModuleCoreConfig.java
index 2cfc7dbedb9..15668f794af 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayModuleCoreConfig.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayModuleCoreConfig.java
@@ -76,7 +76,6 @@ public EmailConfiguration emailConfiguration(
         @Value("#{systemProperties['spring.mail.properties.mail.smtp.timeout']}") Integer smtpTimeout,
         @Value("#{systemProperties['spring.mail.properties.mail.smtp.connectiontimeout']}") Integer smtpConnectionTimeout) {
 
-
         var emailConfiguration = conf.getCore().getRuntimeServices().getEmail();
 
         String senderUsername = _Strings.emptyToNull(senderEmailUsername);
@@ -87,10 +86,10 @@ public EmailConfiguration emailConfiguration(
         int socketTimeout = smtpTimeout!=null ? smtpTimeout : 2000;
         int socketConnectionTimeout = smtpConnectionTimeout!=null ? smtpConnectionTimeout : 2000;
         boolean isThrowExceptionOnFail = emailConfiguration.isThrowExceptionOnFail();
-        String senderAddress = emailConfiguration.getSender().getAddress();
-        String overrideTo = emailConfiguration.getOverride().getTo();
-        String overrideCc = emailConfiguration.getOverride().getCc();
-        String overrideBcc = emailConfiguration.getOverride().getBcc();
+        String senderAddress = _Strings.emptyToNull(emailConfiguration.getSender().getAddress());
+        String overrideTo = _Strings.emptyToNull(emailConfiguration.getOverride().getTo());
+        String overrideCc = _Strings.emptyToNull(emailConfiguration.getOverride().getCc());
+        String overrideBcc = _Strings.emptyToNull(emailConfiguration.getOverride().getBcc());
 
         return new EmailConfiguration(senderUsername, senderPassword, senderHostName, senderPort,
             isSenderTlsEnabled, socketTimeout, socketConnectionTimeout,
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/EmailConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/EmailConfiguration.java
index 6774f9f2331..9f55fa62cf5 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/EmailConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/EmailConfiguration.java
@@ -19,16 +19,100 @@
 package org.apache.causeway.core.config;
 
 public record EmailConfiguration(
+    /**
+     * Specifies the username to use to connect to the SMTP service.
+     * <p>
+     * If not specified, then the sender's {@link #getAddress() email address} will be used instead.
+     * <p>
+     * <code>spring.mail.username</code>
+     */
     String senderUsername,
+    /**
+     * Specifies the password (corresponding to the {@link #getUsername() username} to connect to the
+     * SMTP service.
+     * <p>
+     * This configuration property is mandatory (for the default implementation of the
+     * {@link org.apache.causeway.applib.services.email.EmailService}, at least).
+     * <p>
+     * <code>spring.mail.password</code>
+     */
     String senderPassword,
+    /**
+     * Specifies the host running the SMTP service.
+     * <p>
+     * If not specified, then the value used depends upon the email implementation.
+     * The default implementation will use the <code>mail.smtp.host</code> system
+     * property.
+     * <p>
+     * <code>spring.mail.host</code>
+     */
     String senderHostName,
+    /**
+     * The port to use for sending email.
+     * <p>
+     * <code>spring.mail.port</code>
+     */
     int senderPort,
+    /**
+     * Whether TLS encryption should be started (that is, <code>STARTTLS</code>).
+     * <p>
+     * <code>spring.mail.javamail.properties.mail.smtp.starttls.enable</code>
+     */
     boolean isSenderTlsEnabled,
+    /**
+     * The maximum number of milliseconds to wait to obtain a socket before timing
+     * out.
+     * <p>
+     * <code>spring.mail.properties.mail.smtp.timeout</code>
+     */
     int socketTimeout,
+    /**
+     * The maximum number of milliseconds to wait to obtain a socket connection
+     * before timing out.
+     * <p>
+     * <code>spring.mail.properties.mail.smtp.connectiontimeout</code>
+     */
     int socketConnectionTimeout,
+    /**
+     * If an email fails to send, whether to propagate the exception (meaning that potentially the end-user
+     * might see the exception), or whether instead to just indicate failure through the return value of
+     * the method ({@link org.apache.causeway.applib.services.email.EmailService#send(List, List, List, String, String, DataSource...)}
+     * that's being called.
+     * <p>
+     * <code>causeway.core.runtime-services.email.throwExceptionOnFail</code>
+     */
     boolean isThrowExceptionOnFail,
+    /**
+     * Specifies the email address of the user sending the email.
+     * <p>
+     * If the {@link #getUsername() username} is not specified, is also used as the username to
+     * connect to the SMTP service.
+     * <p>
+     * This configuration property is mandatory (for the default implementation of the
+     * {@link org.apache.causeway.applib.services.email.EmailService}, at least).
+     * <p>
+     * <code>causeway.core.runtime-services.email.sender.address</code>
+     */
     String senderAddress,
+    /**
+     * Intended for testing purposes only, if set then the requested <code>to:</code> of the email will
+     * be ignored, and instead sent to this email address instead.
+     * <p>
+     * <code>causeway.core.runtime-services.email.override.to</code>
+     */
     String overrideTo,
+    /**
+     * Intended for testing purposes only, if set then the requested <code>cc:</code> of the email will
+     * be ignored, and instead sent to this email address instead.
+     * <p>
+     * <code>causeway.core.runtime-services.email.override.cc</code>
+     */
     String overrideCc,
+    /**
+     * Intended for testing purposes only, if set then the requested <code>bcc:</code> of the email will
+     * be ignored, and instead sent to this email address instead.
+     * <p>
+     * <code>causeway.core.runtime-services.email.override.bcc</code>
+     */
     String overrideBcc) {
 }