]> git.mxchange.org Git - jjobs-ejb.git/blobdiff - src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java
Updated copyright year
[jjobs-ejb.git] / src / java / org / mxchange / jusercore / model / user / JobsAdminUserSessionBean.java
index 99344677dc94e08875e1af8061a6d9687d521243..f1c95218c98713a9448ec422b25cdb6aa2be0d1d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 - 2020 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
@@ -41,7 +41,7 @@ public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
        /**
         * Serial number
         */
-       private static final long serialVersionUID = 542_145_347_916L;
+       private static final long serialVersionUID = 542_145_349_001L;
 
        /**
         * Regular user bean
@@ -69,6 +69,12 @@ public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
                } 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
@@ -232,6 +238,12 @@ public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
                } 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
@@ -293,6 +305,12 @@ public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements
                } 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