]> git.mxchange.org Git - addressbook-ejb.git/commitdiff
Continued a bit:
authorRoland Häder <roland@mxchange.org>
Sat, 3 Jun 2017 16:14:04 +0000 (18:14 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 3 Jun 2017 16:14:04 +0000 (18:14 +0200)
- remote interface for resending confirmation link is now genweric in juser-lib
- updated method as checked exceptions are thrown
- updated copyright
- updated jar(s)

Signed-off-by: Roland Häder <roland@mxchange.org>
36 files changed:
lib/jaddressbook-core.jar
lib/jaddressbook-lib.jar
lib/jaddressbook-share-core.jar
lib/jaddressbook-share-lib.jar
lib/jcontacts-business-core.jar
lib/jcontacts-core.jar
lib/jcontacts-lib.jar
lib/jcore-logger-lib.jar
lib/jcoreee.jar
lib/jcountry-core.jar
lib/jcountry-lib.jar
lib/jmailer-ee.jar
lib/jphone-core.jar
lib/jphone-lib.jar
lib/juser-core.jar
lib/juser-lib.jar
src/java/log4j2.xml
src/java/org/mxchange/addressbook/beans/resendlink/AddressbookResendLinkSessionBean.java
src/java/org/mxchange/addressbook/mailer/model/delivery/AddressbookEmailDeliveryMessageBean.java
src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java
src/java/org/mxchange/addressbook/model/addressbook/share/SharedAddressbooksSessionBean.java
src/java/org/mxchange/jcontacts/contact/AddressbookAdminContactSessionBean.java
src/java/org/mxchange/jcontacts/contact/AddressbookContactSessionBean.java
src/java/org/mxchange/jcontacts/phone/AddressbookAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java
src/java/org/mxchange/jmailer/config.properties
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/AddressbookAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/AddressbookMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookAdminPhoneSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/email_address/AddressbookUserEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/login/AddressbookUserLoginSessionBean.java
src/java/org/mxchange/jusercore/model/register/AddressbookUserRegistrationSessionBean.java
src/java/org/mxchange/jusercore/model/user/AddressbookAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/AddressbookUserPasswordHistorySessionBean.java

index 15a7e669f2d6bafd77934bab3fb0c1ed2a6d0cfb..800f61adb71385fcbfbc27b1b8e65ce2ae305508 100644 (file)
Binary files a/lib/jaddressbook-core.jar and b/lib/jaddressbook-core.jar differ
index 935e4f6dede3c73af570fe108f30649615a48f1f..c3cf23fc7ce77434bdfae89ba2eaf5bbb7ef1681 100644 (file)
Binary files a/lib/jaddressbook-lib.jar and b/lib/jaddressbook-lib.jar differ
index f18f0cab2e5f9b4c4c58bd066e3fc8065967624b..6da1a9762c9c89256cc301618fb97a9209359894 100644 (file)
Binary files a/lib/jaddressbook-share-core.jar and b/lib/jaddressbook-share-core.jar differ
index 3a8557ae3e773b20909d080ac4efb6fe57aadd85..b8a7a6431b32b897b3b425de4b30250576a0c39c 100644 (file)
Binary files a/lib/jaddressbook-share-lib.jar and b/lib/jaddressbook-share-lib.jar differ
index a0ca53b9d02f36e1d30269cefd780f092ac072e0..6de90379984e4536915f0abf67334246fccec75a 100644 (file)
Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ
index eaa2463471426757016ba6786661d4a7b471c087..54a8731c3ecc2973c6f9286a08706a16c4a442ab 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 7baf796e4bd5f98534e20916a8329df0cebeaf71..a60343d14a5d410602d777851ed25dc714469436 100644 (file)
Binary files a/lib/jcontacts-lib.jar and b/lib/jcontacts-lib.jar differ
index c8046481dc6d1d52e4cec0137a3fb47448a8f795..3e757cdc2af9b522811655bbbacd2cd6dce2cba9 100644 (file)
Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ
index 7f47a54432a763f3d0b883e7cec8d940444c27c1..1c4dbecc0ac4e4d62ad903e93f26d31c47b8ae2e 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index 5cbad453c2f8698f9ab16791a4e97baef7fa6686..e91ed0ad88c8635e2a9fccb45c289eefa8d2f943 100644 (file)
Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ
index 066e9a10de897adc8457948e4449c71d31e5329e..d3f45e10d9cdf026834a75ecb1186027469f96da 100644 (file)
Binary files a/lib/jcountry-lib.jar and b/lib/jcountry-lib.jar differ
index 8452960c3b4799cdfc9cd2ceda1a0c135c9ba189..9b3912f2f17efabb37a46678205ad319a6f2c52e 100644 (file)
Binary files a/lib/jmailer-ee.jar and b/lib/jmailer-ee.jar differ
index 9587335f2376f8ddf1f9275c0ec27c454450b266..6f596cc999fe3f3bcc5ecb56de3a09ef90910f9f 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index 3c22799492f7a2d81213e1003191b44d016579ff..aa0c7b7f7f079149bf1cf52e6aa554e546a71dd7 100644 (file)
Binary files a/lib/jphone-lib.jar and b/lib/jphone-lib.jar differ
index aa8a72393fba606d8e39c915068e9ea7ca5faf74..fd411f914c67a74da6daa0cce6a4534883b0b9ca 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index e845d87ba2337996bcc8aef68c5b14cfb6c6e763..38a2d3739dc9a9b584d39e9fe49980aec684bac3 100644 (file)
Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ
index 3741761ae97430f8041162218c6ba1b02c14a39e..98e9a65f642174f1e53f38823251423cf6e9f0d3 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (C) 2016 Roland Häder
+Copyright (C) 2016, 2017 Roland Häder
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
index d2925b890c6698e96c2a16c357429daacc28c1a2..e47a11274aaa7784e93a708cf89e6652a7ccdd2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -18,13 +18,21 @@ package org.mxchange.addressbook.beans.resendlink;
 
 import java.text.MessageFormat;
 import java.util.Locale;
+import javax.ejb.EJB;
 import javax.ejb.EJBException;
 import javax.ejb.Stateless;
 import javax.mail.Address;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
 import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
+import org.mxchange.jusercore.exceptions.UserStatusLockedException;
+import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote;
+import org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote;
+import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 
 /**
@@ -40,8 +48,20 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookDatabaseBea
         */
        private static final long serialVersionUID = 71_546_726_857_195_360L;
 
+       /**
+        * Registration bean
+        */
+       @EJB
+       private UserRegistrationSessionBeanRemote registerBean;
+
+       /**
+        * Regular user bean
+        */
+       @EJB
+       private UserSessionBeanRemote userBean;
+
        @Override
-       public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) {
+       public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) throws UserNotFoundException, UserStatusLockedException, UserStatusConfirmedException {
                // Log trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: user={1},locale={2},baseUrl={3} - CALLED!", this.getClass().getSimpleName(), user, locale, baseUrl)); //NOI18N
 
@@ -55,25 +75,38 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookDatabaseBea
                } else if (user.getUserId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+               } else if (!this.userBean.ifUserExists(user)) {
+                       // User not found
+                       throw new UserNotFoundException(user);
                } else if (user.getUserConfirmKey() == null) {
                        // Throw NPE again
                        throw new NullPointerException("this.userConfirmKey is null"); //NOI18N
-               } else if (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED) {
+               } else if (user.getUserAccountStatus() == UserAccountStatus.CONFIRMED) {
+                       // User account status is not UNCONFIRMED
+                       throw new UserStatusConfirmedException(user);
+               } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) {
                        // User account status is not UNCONFIRMED
-                       throw new IllegalStateException(MessageFormat.format("Account status from user.userId={0} is not UNCONFIRMED:{1}", user.getUserId(), user.getUserAccountStatus())); //NOI18N
+                       throw new UserStatusLockedException(user);
                } else if (null == locale) {
                        // Locale should be set
                        throw new NullPointerException("locale is null"); //NOI18N
                }
 
-               // @TODO Unfinished: Change key + merge database
+               // Get new registration key
+               String confirmationKey = this.registerBean.generateConfirmationKey(user);
+
+               // Get managed instance
+               User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
+
+               // Set it in user
+               managedUser.setUserConfirmKey(confirmationKey);
 
                // Init variable
                Address emailAddress;
 
                try {
                        // Create email address and set
-                       emailAddress = new InternetAddress(user.getUserContact().getContactEmailAddress());
+                       emailAddress = new InternetAddress(managedUser.getUserContact().getContactEmailAddress());
                } catch (final AddressException ex) {
                        // Throw again
                        throw new EJBException(ex);
index ea99d1656cacc862421037d8a07319b6649de071..276ad36891a81b2db9f7dcd33a0830dc11e54e6b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index c4c6ebce6743a98ff49d307b6cd897b675c6a381..a572183089883f710010d2749f74ca4e614708af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 901ca67b2e7c85cded1df4d1cd93dfcb17e74314..22c8a2f803f970af8b8b8f66dea0bf58b6f85b89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 4ed5a4001bb1206b1bf6805d338d126922c876e2..2fa7eb3b73ae52228cd808f972b65bbca81bf759 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 410ee2e7f8d2e4cbd9e9ad28e43ab2e9642f7cc5..c4ef0b8be305f9c8835cfced94119961196f2078 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index f5d6110e70e29ce2692c05f629ce34c21012c1d9..a23d9b3e97c1f84d7329f9e18c55aaf1c1ba0f19 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 97b5f776e1fda104eb44e725ba46301fd08eebd9..696a5155761e107d7cc8d0edc652bf58c43aa407 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 45b88a7beacabeb9f4f55a00c820dbda43520e22..5a02e31eeab2f42d7151f359d3b2ac982cd3251e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Roland H\u00e4der
+# Copyright (C) 2016, 2017 Roland H\u00e4der
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
index 66f883c10d7d39395d7843f2784a1c1db02df3ad..31679814cc9fa1774e82008007d336f261244660 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 29e4b0b8de14ce35c6fa24f594d1c8f27f8e60bc..b2605d8b1c84506eec27ff8c07ff1f27b8ada7f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index d4fe99fadac8acc7c9806e56e54853775aef99c8..413a24108546fb29306914eb77a0a591297907a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 0a637d060667144215499a356078196236f6ce1f..a0afc8f5b40639ddf000ab02c9a3bc2eaa14d0ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 3d2ab6cdac8ff828e5120afdeda69b01752b8845..b4065f6a56e828b9b360c0ee12a1dfd52be037c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 54d0ecbb1ac37627c54a50bf5c69de980ad7c7d7..82cfd4b4d7548fcd9c174bef6fe21fbc35968072 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index daf9eb8185825bbf47d43f2e21f9779dcdbed0b8..016ee863eac081a4aac8dc227aedea5abccc29e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 212969ba818e1b41436e37b4f358eb597453b7de..642c3fc5d3f536c6b430d134a7dff5f39ba1e841 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 06ab9ad5ba29a66b1615aea5d3f3d1f39874d7af..f9e21d423194fcc0ea37e9ecef616f291c6c9f78 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index ce16c8e4b0ab2a7f3814e68daf1fa480d393c37e..58a260a8f66d1df8c8c3c92721cd8701872ac08c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as