From 1a90ba486f511e1f687ad8a06f866f3dff2b2134 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 --- .../model/user/PizzaAdminUserSessionBean.java | 4 +--- .../model/user/PizzaUserSessionBean.java | 2 +- .../PizzaUserEmailChangeSessionBean.java | 4 ++-- .../user/login/PizzaUserLoginSessionBean.java | 18 +++++++++--------- .../PizzaUserRegistrationSessionBean.java | 10 +++++----- .../resendlink/PizzaResendLinkSessionBean.java | 8 ++++---- 6 files changed, 22 insertions(+), 24 deletions(-) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/login/PizzaUserLoginSessionBean.java (89%) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/register/PizzaUserRegistrationSessionBean.java (95%) rename src/java/org/mxchange/{jusercore => juserlogincore}/model/user/resendlink/PizzaResendLinkSessionBean.java (93%) diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java index 8747f10..315f683 100644 --- a/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/PizzaAdminUserSessionBean.java @@ -27,8 +27,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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** @@ -262,7 +262,6 @@ public class PizzaAdminUserSessionBean extends BasePizzaDatabaseBean implements User updatedUser = 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", updatedUser, baseUrl, null); //NOI18N @@ -322,7 +321,6 @@ public class PizzaAdminUserSessionBean extends BasePizzaDatabaseBean implements User updatedUser = 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", updatedUser, baseUrl, null); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java index c1d02c6..5d19610 100644 --- a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java @@ -40,8 +40,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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** diff --git a/src/java/org/mxchange/jusercore/model/user/email_address/PizzaUserEmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/user/email_address/PizzaUserEmailChangeSessionBean.java index 97209b4..075f845 100644 --- a/src/java/org/mxchange/jusercore/model/user/email_address/PizzaUserEmailChangeSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/email_address/PizzaUserEmailChangeSessionBean.java @@ -27,7 +27,7 @@ import javax.persistence.Query; 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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** @@ -209,7 +209,7 @@ public class PizzaUserEmailChangeSessionBean extends BasePizzaDatabaseBean imple // 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", emailAddressChange.getEmailAddress(), emailAddressChange.toString())); //NOI18N + hash = UserLoginUtils.encryptPassword(String.format("%s:%s", emailAddressChange.getEmailAddress(), emailAddressChange.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/PizzaUserLoginSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/login/PizzaUserLoginSessionBean.java similarity index 89% rename from src/java/org/mxchange/jusercore/model/user/login/PizzaUserLoginSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/login/PizzaUserLoginSessionBean.java index 98180bb..5a8e7b1 100644 --- a/src/java/org/mxchange/jusercore/model/user/login/PizzaUserLoginSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/login/PizzaUserLoginSessionBean.java @@ -14,22 +14,22 @@ * 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.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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** @@ -125,8 +125,8 @@ public class PizzaUserLoginSessionBean extends BasePizzaDatabaseBean implements * 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 PizzaUserLoginSessionBean extends BasePizzaDatabaseBean implements } // 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/PizzaUserRegistrationSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/register/PizzaUserRegistrationSessionBean.java similarity index 95% rename from src/java/org/mxchange/jusercore/model/user/register/PizzaUserRegistrationSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/register/PizzaUserRegistrationSessionBean.java index 863d1c6..c77f2ae 100644 --- a/src/java/org/mxchange/jusercore/model/user/register/PizzaUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/register/PizzaUserRegistrationSessionBean.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; @@ -29,7 +29,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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** @@ -62,7 +62,7 @@ public class PizzaUserRegistrationSessionBean extends BasePizzaDatabaseBean impl */ public PizzaUserRegistrationSessionBean () { // Call super constructor - super("jms/pizzaservice-queue-factory", "jms/pizzaservice-email-queue"); //NOI18N + super("jms/addressbook-queue-factory", "jms/addressbook-email-queue"); //NOI18N } @Override @@ -85,7 +85,7 @@ public class PizzaUserRegistrationSessionBean extends BasePizzaDatabaseBean impl // 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 @@ -190,7 +190,7 @@ public class PizzaUserRegistrationSessionBean extends BasePizzaDatabaseBean impl // Send email // @TODO: Internationlize the subject line somehow - this.sendEmail("User registration", templateName, addedUser, baseUrl, randomPassword); //NOI18N + this.sendEmail("Registration", templateName, addedUser, baseUrl, randomPassword); //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: addedUser={1},addedUser.userId={2} - EXIT!", this.getClass().getSimpleName(), addedUser, addedUser.getUserId())); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/resendlink/PizzaResendLinkSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/resendlink/PizzaResendLinkSessionBean.java similarity index 93% rename from src/java/org/mxchange/jusercore/model/user/resendlink/PizzaResendLinkSessionBean.java rename to src/java/org/mxchange/juserlogincore/model/user/resendlink/PizzaResendLinkSessionBean.java index 6cdf837..8ece7a9 100644 --- a/src/java/org/mxchange/jusercore/model/user/resendlink/PizzaResendLinkSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/resendlink/PizzaResendLinkSessionBean.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; @@ -26,8 +26,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; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** @@ -60,7 +60,7 @@ public class PizzaResendLinkSessionBean extends BasePizzaDatabaseBean implements */ public PizzaResendLinkSessionBean () { // Call super constructor - super("jms/pizzaservice-queue-factory", "jms/pizzaservice-email-queue"); //NOI18N + super("jms/addressbook-queue-factory", "jms/addressbook-email-queue"); //NOI18N } @Override @@ -109,7 +109,7 @@ public class PizzaResendLinkSessionBean extends BasePizzaDatabaseBean implements // 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