/*
- * Copyright (C) 2016 - 2018 Free Software Foundation
+ * Copyright (C) 2016 - 2024 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/**
* Serial number
*/
- private static final long serialVersionUID = 542_145_347_916L;
+ private static final long serialVersionUID = 542_145_349_001L;
/**
* Regular user bean
*/
- @EJB
+ @EJB (lookup = "java:global/jjobs-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
private UserSessionBeanRemote userBean;
/**
} 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
}
// Set created timestamp
- user.setUserCreated(new Date());
- user.getUserContact().setContactCreated(new Date());
+ user.setUserEntryCreated(new Date());
+ user.getUserContact().setContactEntryCreated(new Date());
// Update mobile, land-line and fax instance
this.setAllPhoneEntriesCreated(user.getUserContact());
user.setUserContact(foundContact);
// Set timestamp
- user.setUserCreated(new Date());
+ user.setUserEntryCreated(new Date());
// Perist it
this.getEntityManager().persist(user);
} else if (userLockReason.isEmpty()) {
// Is empty
throw new IllegalArgumentException("userLockReason is empty"); //NOI18N
+ } else if (null == baseUrl) {
+ // Throw NPE again
+ throw new NullPointerException("baseUrl is null"); //NOI18N
+ } else if (baseUrl.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("baseUrl is empty"); //NOI18N
}
// Remove contact instance as this is not updated
} else if (user.getUserAccountStatus() == UserAccountStatus.UNCONFIRMED) {
// Account is unconfirmed
throw new UserStatusUnconfirmedException(user);
+ } else if (null == baseUrl) {
+ // Throw NPE again
+ throw new NullPointerException("baseUrl is null"); //NOI18N
+ } else if (baseUrl.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("baseUrl is empty"); //NOI18N
}
// Remove contact instance as this is not updated