]> git.mxchange.org Git - pizzaservice-mailer-ejb.git/blobdiff - src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java
updated own name and resources
[pizzaservice-mailer-ejb.git] / src / java / org / mxchange / jusercore / model / user / AddressbookUserSessionBean.java
index a4e57bd6e3d73793218e4bf71586c46b073b113c..06ab9ad5ba29a66b1615aea5d3f3d1f39874d7af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -46,7 +46,7 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 /**
  * A user EJB
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "user", description = "A bean handling the user data")
 public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean implements UserSessionBeanRemote {
@@ -598,9 +598,9 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        }
 
        @Override
-       public PasswordHistory updateUserPassword (final User user) throws UserNotFoundException, UserStatusUnconfirmedException, UserStatusLockedException {
+       public PasswordHistory updateUserPassword (final User user, final String baseUrl) throws UserNotFoundException, UserStatusUnconfirmedException, UserStatusLockedException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPassword: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPassword: user={1},baseUrl={2} - CALLED!", this.getClass().getSimpleName(), user, baseUrl)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -618,6 +618,12 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                } else if (!this.ifUserExists(user)) {
                        // User does not exist
                        throw new EJBException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
+               } else if (null == baseUrl) {
+                       // Abort here
+                       throw new NullPointerException("password is null"); //NOI18N
+               } else if (baseUrl.isEmpty()) {
+                       // Abort here
+                       throw new IllegalArgumentException("password is empty"); //NOI18N
                }
 
                // Call other method