]> git.mxchange.org Git - jjobs-war.git/commitdiff
Introduced createUserLogin() (safe to cherry-pick)
authorRoland Häder <roland@mxchange.org>
Fri, 6 May 2016 11:06:52 +0000 (13:06 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 6 May 2016 21:20:58 +0000 (23:20 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java

index 43bd92545e196b2d691e9fc936c42c55a9af1104..e79a0f794718b450f9beba580b936873b0d083dc 100644 (file)
@@ -113,7 +113,7 @@ public class JobsUserLoginWebSessionBean implements JobsUserLoginWebSessionContr
        @Override
        public String doLogin () {
                // Get user instance
-               User user = this.userController.createUserInstance();
+               User user = this.userController.createUserLogin();
 
                // Create login container
                LoginContainer container = new UserLoginContainer(user, this.userController.getUserPassword());
index 4318d4102f1812cbff30e46f0c68cf3dfebc71b9..c95bc7c1602a5c49386b8231b9d06b32bd0a45fb 100644 (file)
@@ -359,6 +359,33 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                return localUser;
        }
 
+       @Override
+       public User createUserLogin () {
+               // Trace message
+               //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: CALLED!", this.getClass().getSimpleName()));
+
+               // Is all data set?
+               if (this.getUserName() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("recruiterName is null"); //NOI18N
+               } else if (this.getUserName().isEmpty()) {
+                       // Is empty
+                       throw new IllegalStateException("recruiterName is empty."); //NOI18N
+               }
+
+               // Create new recruiter instance
+               User recruiter = new LoginUser();
+
+               // Update all data ...
+               recruiter.setUserName(this.getUserName());
+
+               // Trace message
+               //* NOISY-DEBUG */ System.out.println(MessageFormat.format("{0}.createUserLogin: recruiter={1} - EXIT!", this.getClass().getSimpleName(), recruiter));
+
+               // Return the new instance
+               return recruiter;
+       }
+
        @Override
        public String doChangePersonalData () {
                // This method shall only be called if the user is logged-in
index cbce3c0153cf6044c55eabab9cd688d935f2d716..e7869ec9c37c4798ca31a1a2882150519f1b9789 100644 (file)
@@ -149,6 +149,13 @@ public interface JobsUserWebSessionController extends Serializable {
         */
        User createUserInstance ();
 
+       /**
+        * Creates a user instance for login phase
+        * <p>
+        * @return User instance
+        */
+       User createUserLogin ();
+
        /**
         * Getter for user id
         * <p>