From 3bee47202f8b4ab14aeee9f472b3d975c6ff25d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 22 Jun 2017 22:50:18 +0200 Subject: [PATCH] Please cherry-pick: - sendEmail() will now accept randomPassword parameter. Set to NULL if you don't want/can set it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../database/BaseFinancialsDatabaseBean.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java b/src/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java index 6a62a41..d7da3e2 100644 --- a/src/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java +++ b/src/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java @@ -113,7 +113,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { /** * Returns a detached instance from given mobile instance *

- * @param mobileNumber Mobile instance + * @param mobileNumber Mobile instance * @param fetchedNumber Found mobile number in database *

* @return Detached instance @@ -162,7 +162,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { * Returns a detached instance from given land-line instance *

* @param landLineNumber Land-line instance - * @param fetchedNumber Found land-line number in database + * @param fetchedNumber Found land-line number in database *

* @return Detached instance */ @@ -207,7 +207,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { /** * Returns a detached instance from given fax instance *

- * @param faxNumber Fax instance + * @param faxNumber Fax instance * @param fetchedNumber Found fax number in database *

* @return Detached instance @@ -449,13 +449,15 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { * Sends an email with given subject line, template name to given recipient * and user data *

- * @param subjectLine Subject line - * @param templateName Template name - * @param emailAddress Recipient's email address - * @param user User instance - * @param baseUrl Base URL + * @param subjectLine Subject line + * @param templateName Template name + * @param emailAddress Recipient's email address + * @param user User instance + * @param baseUrl Base URL + * @param randomPassword A randomly-generated password or NULL if user had + * to enter it. */ - protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl) { + protected void sendEmail (final String subjectLine, final String templateName, final Address emailAddress, final User user, final String baseUrl, final String randomPassword) { // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmail: subjectLine={0},templateName={1},emailAddress={2},user={3},baseUrl={4} - CALLED!", subjectLine, templateName, emailAddress, user, baseUrl)); //NOI18N @@ -475,7 +477,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { } else if (null == emailAddress) { // Throw NPE throw new NullPointerException("emailAddress is null"); //NOI18N - }else if (null == user) { + } else if (null == user) { // Throw NPE throw new NullPointerException("user is null"); //NOI18N } else if (user.getUserId() == null) { @@ -513,8 +515,9 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { // Set all values Properties variables = UserUtils.getAllUserFields(user); - // Set base URL + // Set base URL and random password variables.put("baseUrl", baseUrl); //NOI18N + variables.put("randomPassword", randomPassword); //NOI18N // Set all // @TODO Language from message bundle @@ -545,7 +548,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { * should be the same. *

* @param contact Contact to set instances - * @param other Other contact to get instances from + * @param other Other contact to get instances from */ protected void setAllContactPhoneEntries (final Contact contact, final Contact other) { // Trace message @@ -624,13 +627,13 @@ public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean { /** * Updates all contact's phone entry's updated timestamps *

- * @param contact Contact instance to update - * @param isMobileUnlinked Whether a mobile entry has been unlinked in - * contact instance + * @param contact Contact instance to update + * @param isMobileUnlinked Whether a mobile entry has been unlinked in + * contact instance * @param isLandlineUnlinked Whether a land-line entry has been unlinked in - * contact instance - * @param isFaxUnlinked Whether a fax entry has been unlinked in contact - * instance + * contact instance + * @param isFaxUnlinked Whether a fax entry has been unlinked in + * contact instance */ protected void setAllContactPhoneEntriesUpdated (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) { // Trace message -- 2.39.5