]> git.mxchange.org Git - addressbook-mailer-ejb.git/blobdiff - src/java/org/mxchange/jusercore/model/login/AddressbookUserLoginSessionBean.java
updated jar(s)
[addressbook-mailer-ejb.git] / src / java / org / mxchange / jusercore / model / login / AddressbookUserLoginSessionBean.java
index 7c0090bd049692c3f64110c85a24789e59d8da97..347f87eea901c9a0ed681abb744fcf019742047a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016, 2017 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
@@ -19,25 +19,26 @@ package org.mxchange.jusercore.model.login;
 import java.text.MessageFormat;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
+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.register.UserRegistrationSessionBeanRemote;
+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;
 
 /**
- * A session bean for user logins
+ * A session EJB for user logins
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
-@Stateless (name = "login", mappedName = "ejb/stateless-addressbook-login", description = "A bean handling the user login for Addressbook project")
-public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements UserLoginSessionBeanRemote {
+@Stateless (name = "login", description = "A bean handling the user login for Addressbook project")
+public class AddressbookUserLoginSessionBean extends BaseAddressbookDatabaseBean implements UserLoginSessionBeanRemote {
 
        /**
         * Serial number
@@ -45,21 +46,29 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
        private static final long serialVersionUID = 21_785_978_127_581_965L;
 
        /**
-        * Registration bean
+        * Registration EJB
         */
        @EJB
        private UserRegistrationSessionBeanRemote registerBean;
 
        /**
-        * User bean
+        * User EJB
         */
        @EJB
        private UserSessionBeanRemote userBean;
 
+       /**
+        * Default constructor
+        */
+       public AddressbookUserLoginSessionBean () {
+               // Call super constructor
+               super();
+       }
+
        @Override
        public User validateUserAccountStatus (final LoginContainer container) throws UserNotFoundException, UserStatusLockedException, UserStatusUnconfirmedException, UserPasswordMismatchException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: container={0} - CALLED!", container)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: container={1} - CALLED!", this.getClass().getSimpleName(), container)); //NOI18N
 
                // Check some beans
                assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
@@ -105,7 +114,7 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: updatedUser={0} - EXIT!", updatedUser)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N
 
                // Return it
                return updatedUser;
@@ -116,9 +125,9 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
         * not match, the first one is the one from the calling bean/controller, the
         * second is the from database.
         * <p>
-        * @param container   Container instance holding the user instance and
-        *                    unencrypted password
-        * @param updatedUser User instance found for given user name
+        * @param container Container instance holding the user instance and
+        * clear-text password
+        * @param updatedUser Updated user instance found for given user name
         * <p>
         * @return Whether the password matches
         */
@@ -138,4 +147,5 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
                // Is it the same same password?
                return UserUtils.ifPasswordMatches(container, updatedUser);
        }
+
 }