From 2aae212c5b641b9f2c5459f779ac1ca1ddf9d37a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 12 Jul 2017 21:13:56 +0200 Subject: [PATCH] Please cherry-pick: - imported new location (package) of classes/interfaces - moved EJBs to proper locations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../user/AddressbookAdminUserSessionBean.java | 4 +--- .../model/user/AddressbookUserSessionBean.java | 2 +- .../AddressbookUserEmailChangeSessionBean.java | 4 ++-- .../login/FinancialsUserLoginSessionBean.java | 18 +++++++++--------- ...AddressbookUserRegistrationSessionBean.java | 6 +++--- .../AddressbookResendLinkSessionBean.java | 6 +++--- 6 files changed, 19 insertions(+), 21 deletions(-) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/login/FinancialsUserLoginSessionBean.java (89%) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/register/AddressbookUserRegistrationSessionBean.java (97%) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/resendlink/AddressbookResendLinkSessionBean.java (95%) diff --git a/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java index 1dc8927..e2e86d7 100644 --- a/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java @@ -28,8 +28,8 @@ import org.mxchange.jusercore.exceptions.UserNotFoundException; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; -import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote; /** * An administrative user EJB @@ -262,7 +262,6 @@ public class AddressbookAdminUserSessionBean extends BaseAddressbookDatabaseBean User managedUser = this.userBean.updateUserData(user); // @TODO Create user lock history entry - // Send out email // @TODO externalize subject line this.sendEmail("User account locked", "user_account_locked", managedUser, baseUrl, null); //NOI18N @@ -322,7 +321,6 @@ public class AddressbookAdminUserSessionBean extends BaseAddressbookDatabaseBean User managedUser = this.userBean.updateUserData(user); // @TODO Create user lock history entry - // Send out email // @TODO externalize subject line this.sendEmail("User account unlocked", "user_account_unlocked", managedUser, baseUrl, null); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java index 6a0724b..093283a 100644 --- a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java @@ -41,8 +41,8 @@ import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; import org.mxchange.jusercore.model.user.password_history.PasswordHistory; import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; -import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote; /** * A user EJB diff --git a/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java index c035310..008e75d 100644 --- a/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/email_address/AddressbookUserEmailChangeSessionBean.java @@ -28,7 +28,7 @@ import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean; import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; import org.mxchange.jusercore.model.email_address.EmailAddressChange; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; -import org.mxchange.jusercore.model.user.UserUtils; +import org.mxchange.juserlogincore.login.UserLoginUtils; /** * A session-scoped bean for changing email addresses @@ -206,7 +206,7 @@ public class AddressbookUserEmailChangeSessionBean extends BaseAddressbookDataba // Search for free hash while (isUsed) { // Generate hash, there is already in UserUtils a nice method that can be used for this purpose. - hash = UserUtils.encryptPassword(String.format("%s:%s", emailAddress.getEmailAddress(), emailAddress.toString())); //NOI18N + hash = UserLoginUtils.encryptPassword(String.format("%s:%s", emailAddress.getEmailAddress(), emailAddress.toString())); //NOI18N // The hash *may* be unique, better test it Query query = this.getEntityManager().createNamedQuery("SearchEmailChangeByHash", EmailAddressChange.class); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/login/FinancialsUserLoginSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/login/FinancialsUserLoginSessionBean.java similarity index 89% rename from src/java/org/mxchange/jusercore/model/user/login/FinancialsUserLoginSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/login/FinancialsUserLoginSessionBean.java index 699565c..99fb347 100644 --- a/src/java/org/mxchange/jusercore/model/user/login/FinancialsUserLoginSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/login/FinancialsUserLoginSessionBean.java @@ -14,23 +14,23 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.user.login; +package org.mxchange.juserlogincore.model.user.login; import java.text.MessageFormat; import javax.ejb.EJB; import javax.ejb.Stateless; import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean; -import org.mxchange.jusercore.container.login.LoginContainer; import org.mxchange.jusercore.exceptions.UserNotFoundException; -import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; -import org.mxchange.jusercore.model.login.user.UserLoginSessionBeanRemote; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; -import org.mxchange.jusercore.model.user.UserUtils; -import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.juserlogincore.container.login.LoginContainer; +import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException; +import org.mxchange.juserlogincore.login.UserLoginUtils; +import org.mxchange.juserlogincore.model.login.user.UserLoginSessionBeanRemote; +import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote; /** * A session EJB for user logins @@ -125,8 +125,8 @@ public class FinancialsUserLoginSessionBean extends BaseAddressbookDatabaseBean * not match, the first one is the one from the calling bean/controller, the * second is the from database. *

- * @param container Container instance holding the user instance and - * clear-text password + * @param container Container instance holding the user instance and + * clear-text password * @param updatedUser Updated user instance found for given user name *

* @return Whether the password matches @@ -145,7 +145,7 @@ public class FinancialsUserLoginSessionBean extends BaseAddressbookDatabaseBean } // Is it the same same password? - return UserUtils.ifPasswordMatches(container, updatedUser); + return UserLoginUtils.ifPasswordMatches(container, updatedUser); } } diff --git a/src/java/org/mxchange/jusercore/model/user/register/AddressbookUserRegistrationSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java similarity index 97% rename from src/java/org/mxchange/jusercore/model/user/register/AddressbookUserRegistrationSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java index 385111d..60bade0 100644 --- a/src/java/org/mxchange/jusercore/model/user/register/AddressbookUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/register/AddressbookUserRegistrationSessionBean.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.user.register; +package org.mxchange.juserlogincore.model.user.register; import java.text.MessageFormat; import java.util.Objects; @@ -30,7 +30,7 @@ import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; -import org.mxchange.jusercore.model.user.UserUtils; +import org.mxchange.juserlogincore.login.UserLoginUtils; /** * A session-scoped bean for user registration @@ -85,7 +85,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab // Find a free one while (confirmationKey == null) { // Create new one - String key = UserUtils.generatedConfirmationKey(user); + String key = UserLoginUtils.generatedConfirmationKey(user); // Set key as parameter query.setParameter("confirmKey", key); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/resendlink/AddressbookResendLinkSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java similarity index 95% rename from src/java/org/mxchange/jusercore/model/user/resendlink/AddressbookResendLinkSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java index e79147a..77d5f44 100644 --- a/src/java/org/mxchange/jusercore/model/user/resendlink/AddressbookResendLinkSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/resendlink/AddressbookResendLinkSessionBean.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.user.resendlink; +package org.mxchange.juserlogincore.model.user.resendlink; import java.text.MessageFormat; import java.util.Locale; @@ -27,8 +27,8 @@ import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.UserSessionBeanRemote; -import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote; /** * A session-based EJB for resending confirmation links @@ -109,7 +109,7 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookDatabaseBea // Send email // @TODO: Internationlize the subject line somehow - this.sendEmail("Resend user confirmation link", "user_resend_confirmation_link", managedUser, baseUrl, null); //NOI18N + this.sendEmail("Resend user confirmation link", "user_resend_confirmation_link", managedUser, baseUrl, null); //NOI18N // Log trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: managedUser={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N -- 2.39.5