@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());
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