} else if (user.getUserId() instanceof Long) {
// Not allowed here
throw new IllegalStateException(MessageFormat.format("user.userId must be null, is: {0}", user.getUserId())); //NOI18N
+ } else if (null == user.getUserContact()) {
+ // Abort here
+ throw new NullPointerException("user.contact is null"); //NOI18N
+ } else if (user.getUserContact().getContactId() != null) {
+ // Not allowed here
+ throw new IllegalStateException(MessageFormat.format("user.userContact.contactId must be null, is: {0}", user.getUserId())); //NOI18N
}
// Check if user is registered
import java.util.Date;
import java.util.List;
import java.util.Objects;
-import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.ejb.Stateless;
import javax.persistence.Query;
import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
import org.mxchange.pizzaaplication.enterprise.BasePizzaEnterpriseBean;
/**
*/
private static final long serialVersionUID = 542_145_347_916L;
- /**
- * Registration EJB
- */
- @EJB (lookup = "java:global/pizzaservice-ejb/userRegistration!org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote")
- private UserRegistrationSessionBeanRemote registerBean;
-
/**
* Default constructor
*/
// Throw it again
throw new NullPointerException("baseUrl is null"); //NOI18N
} else if (baseUrl.isEmpty()) {
- // Invalid parameter
+ // Throw IAE
throw new IllegalArgumentException("baseUrl is empty"); //NOI18N
}
managedUser.setUserEntryUpdated(new Date());
// Create history entry
- PasswordHistory entry = new UserPasswordHistory(user.getUserEncryptedPassword(), managedUser);
+ final PasswordHistory entry = new UserPasswordHistory(user.getUserEncryptedPassword(), managedUser);
// Set created timestamp
entry.setUserPasswordHistoryCreated(new Date());