]> git.mxchange.org Git - jjobs-mailer-ejb.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 21:00:41 +0000 (22:00 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 22:15:28 +0000 (23:15 +0100)
- added new entity class for changing email addresses
- added EJB for changing email addresses which has an injected user EJB
- updated jar(s)

lib/juser-core.jar
lib/juser-lib.jar
nbproject/build-impl.xml
nbproject/genfiles.properties
nbproject/project.properties
nbproject/project.xml
src/conf/persistence.xml
src/java/org/mxchange/jusercore/model/email_address/EmailChangeSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jusercore/model/user/UserSessionBean.java

index 22b1352719e70921cb178edbaf2f44438454ab4e..7dad4a093ec73a3f597125d3068b39e293fae567 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index 985516ffe2939cd31bb9248be244e20ccb985be7..f637271c38803627467b683fb564c07db7c11532 100644 (file)
Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ
index a38545049b8021aa7e7b427f5f6bfbc3844b3f62..6a0a390c4bb4463939b93e00840464ca8c48a6f8 100644 (file)
@@ -809,11 +809,17 @@ exists or setup the property manually. For example like this:
         <ant antfile="${project.addressbook-lib}/build.xml" inheritall="false" target="jar">
             <property name="deploy.on.save" value="false"/>
         </ant>
+        <ant antfile="${project.juser-core}/build.xml" inheritall="false" target="jar">
+            <property name="deploy.on.save" value="false"/>
+        </ant>
     </target>
     <target depends="init" if="dist.ear.dir" name="-deps-ear-jar" unless="no.deps">
         <ant antfile="${project.addressbook-lib}/build.xml" inheritall="false" target="jar">
             <property name="deploy.on.save" value="false"/>
         </ant>
+        <ant antfile="${project.juser-core}/build.xml" inheritall="false" target="jar">
+            <property name="deploy.on.save" value="false"/>
+        </ant>
     </target>
     <target depends="init, -deps-module-jar, -deps-ear-jar" name="deps-jar"/>
     <target depends="init,deps-jar" name="-pre-pre-compile">
@@ -836,6 +842,7 @@ exists or setup the property manually. For example like this:
         <copyfiles files="${file.reference.juser-core.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${file.reference.juser-lib.jar}" todir="${build.classes.dir}"/>
         <copyfiles files="${reference.addressbook-lib.jar}" todir="${build.classes.dir}"/>
+        <copyfiles files="${reference.juser-core.jar}" todir="${build.classes.dir}"/>
     </target>
     <target if="is.server.weblogic" name="-library-inclusion-in-archive-weblogic">
         <basename file="${file.reference.jcore.jar}" property="manifest.file.reference.jcore.jar"/>
@@ -848,8 +855,9 @@ exists or setup the property manually. For example like this:
         <basename file="${file.reference.juser-core.jar}" property="manifest.file.reference.juser-core.jar"/>
         <basename file="${file.reference.juser-lib.jar}" property="manifest.file.reference.juser-lib.jar"/>
         <basename file="${reference.addressbook-lib.jar}" property="manifest.reference.addressbook-lib.jar"/>
+        <basename file="${reference.juser-core.jar}" property="manifest.reference.juser-core.jar"/>
         <manifest file="${build.ear.classes.dir}/META-INF/MANIFEST.MF" mode="update">
-            <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 jar-7 jar-8 jar-9 jar-10 "/>
+            <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 jar-7 jar-8 jar-9 jar-10 jar-11 "/>
             <attribute name="jar-1-Extension-Name" value="${manifest.file.reference.jcore.jar}"/>
             <attribute name="jar-2-Extension-Name" value="${manifest.file.reference.jcoreee.jar}"/>
             <attribute name="jar-3-Extension-Name" value="${manifest.file.reference.jcore-logger-lib.jar}"/>
@@ -860,6 +868,7 @@ exists or setup the property manually. For example like this:
             <attribute name="jar-8-Extension-Name" value="${manifest.file.reference.juser-core.jar}"/>
             <attribute name="jar-9-Extension-Name" value="${manifest.file.reference.juser-lib.jar}"/>
             <attribute name="jar-10-Extension-Name" value="${manifest.reference.addressbook-lib.jar}"/>
+            <attribute name="jar-11-Extension-Name" value="${manifest.reference.juser-core.jar}"/>
         </manifest>
     </target>
     <target depends="compile" name="library-inclusion-in-manifest">
@@ -873,6 +882,7 @@ exists or setup the property manually. For example like this:
         <copyfiles files="${file.reference.juser-core.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.juser-lib.jar}" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${reference.addressbook-lib.jar}" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${reference.juser-core.jar}" todir="${dist.ear.dir}/lib"/>
         <manifest file="${build.ear.classes.dir}/META-INF/MANIFEST.MF" mode="update"/>
     </target>
     <target name="-copy-meta-inf">
@@ -1257,6 +1267,7 @@ exists or setup the property manually. For example like this:
             -->
     <target depends="init" name="deps-clean" unless="no.deps">
         <ant antfile="${project.addressbook-lib}/build.xml" inheritall="false" target="clean"/>
+        <ant antfile="${project.juser-core}/build.xml" inheritall="false" target="clean"/>
     </target>
     <target depends="init" name="-do-clean">
         <delete dir="${build.dir}"/>
index 5217369d60343188665bc432d767b2a7b1a3b2bb..4f6f54093e5a0ae91de29544ea58213c1139eb24 100644 (file)
@@ -3,6 +3,6 @@ build.xml.script.CRC32=7d41e0fd
 build.xml.stylesheet.CRC32=5910fda3@1.51.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=73853deb
-nbproject/build-impl.xml.script.CRC32=b9ae5896
+nbproject/build-impl.xml.data.CRC32=578b807a
+nbproject/build-impl.xml.script.CRC32=34424534
 nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.55.1
index 4e968a24fe7d20a0d0e919e25c77b89dc8ef15f0..2fb4f979b905e4dfe93c51e9e9173a7a70e5b7e4 100644 (file)
@@ -54,7 +54,8 @@ javac.classpath=\
     ${file.reference.jcontacts-business-core.jar}:\
     ${file.reference.juser-core.jar}:\
     ${file.reference.juser-lib.jar}:\
-    ${reference.addressbook-lib.jar}
+    ${reference.addressbook-lib.jar}:\
+    ${reference.juser-core.jar}
 javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
 javac.debug=true
 javac.deprecation=true
@@ -82,8 +83,10 @@ meta.inf=${source.root}/conf
 meta.inf.excludes=sun-cmp-mappings.xml
 platform.active=default_platform
 project.addressbook-lib=../addressbook-lib
+project.juser-core=../juser-core
 project.license=gpl30
 reference.addressbook-lib.jar=${project.addressbook-lib}/dist/addressbook-lib.jar
+reference.juser-core.jar=${project.juser-core}/dist/juser-core.jar
 resource.dir=setup
 run.test.classpath=\
     ${javac.test.classpath}:\
index 7e8512459863a4acb7c235e8189d3a594a860f0b..8d34321aa88445be18d624191876cc818fbcd0a8 100644 (file)
@@ -15,6 +15,7 @@
             <included-library dirs="200">file.reference.juser-core.jar</included-library>
             <included-library dirs="200">file.reference.juser-lib.jar</included-library>
             <included-library dirs="200">reference.addressbook-lib.jar</included-library>
+            <included-library dirs="200">reference.juser-core.jar</included-library>
             <source-roots>
                 <root id="src.dir"/>
             </source-roots>
                 <clean-target>clean</clean-target>
                 <id>jar</id>
             </reference>
+            <reference>
+                <foreign-project>juser-core</foreign-project>
+                <artifact-type>jar</artifact-type>
+                <script>build.xml</script>
+                <target>jar</target>
+                <clean-target>clean</clean-target>
+                <id>jar</id>
+            </reference>
         </references>
     </configuration>
 </project>
index 92674db7070448b04e606922f2a74e1825a3f047..f6b140dbd2caef921acd26d914f305c8fbd1c002 100644 (file)
@@ -19,6 +19,7 @@
     <class>org.mxchange.jphone.phonenumbers.fax.FaxNumber</class>
     <class>org.mxchange.jphone.phonenumbers.landline.LandLineNumber</class>
     <class>org.mxchange.jphone.phonenumbers.smsprovider.CellphoneProvider</class>
+    <class>org.mxchange.jusercore.model.email_address.EmailAddressChange</class>
     <class>org.mxchange.jusercore.model.user.LoginUser</class>
     <exclude-unlisted-classes>false</exclude-unlisted-classes>
     <properties>
diff --git a/src/java/org/mxchange/jusercore/model/email_address/EmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/email_address/EmailChangeSessionBean.java
new file mode 100644 (file)
index 0000000..bb4131a
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2016 quix0r
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jusercore.model.email_address;
+
+import java.text.MessageFormat;
+import javax.ejb.Stateless;
+import javax.inject.Inject;
+import javax.persistence.PersistenceException;
+import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
+
+/**
+ * A session bean for changing email addresses
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Stateless (name = "email-change", mappedName = "ejb/stateless-addressbook-email-change", description = "A bean handling email changes")
+public class EmailChangeSessionBean extends BaseDatabaseBean implements EmailChangeSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 182_698_165_971_548L;
+
+       /**
+        * User bean
+        */
+       @Inject
+       private UserSessionBeanRemote userBean;
+
+       /**
+        * Default constructor
+        */
+       public EmailChangeSessionBean () {
+       }
+
+       @Override
+       public void enqueueEmailAddressForChange (final User user) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("enqueueEmailAddressForChange: user={0} - CALLED!", user));
+
+               // user should not be null
+               if (null == user) {
+                       // Abort here
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
+               } else if (user.getUserAccountStatus() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
+               } else if (!this.userBean.ifUserIdExists(user.getUserId())) {
+                       // User does not exist
+                       throw new PersistenceException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
+               }
+
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public void updateEmailAddress (final User user) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateEmailAddress: user={0} - CALLED!", user));
+
+               // user should not be null
+               if (null == user) {
+                       // Abort here
+                       throw new NullPointerException("user is null"); //NOI18N
+               } else if (user.getUserId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userId is null"); //NOI18N
+               } else if (user.getUserId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
+               } else if (user.getUserAccountStatus() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
+               } else if (!this.userBean.ifUserIdExists(user.getUserId())) {
+                       // User does not exist
+                       throw new PersistenceException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
+               }
+
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+}
index 1b6e197b1c70d96a33f568013dfe6c5d505f049d..4795d84bec1f1295ca3a07df1e3c38fb7045cda5 100644 (file)
@@ -288,58 +288,6 @@ public class UserSessionBean extends BaseDatabaseBean implements UserSessionBean
                return true;
        }
 
-       @Override
-       public void enqueueEmailAddressForChange (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("enqueueEmailAddressForChange: user={0} - CALLED!", user));
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
-               } else if (user.getUserAccountStatus() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
-               } else if (!this.ifUserIdExists(user.getUserId())) {
-                       // User does not exist
-                       throw new PersistenceException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
-               }
-
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
-       @Override
-       public void updateEmailAddress (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateEmailAddress: user={0} - CALLED!", user));
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N
-               } else if (user.getUserAccountStatus() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
-               } else if (!this.ifUserIdExists(user.getUserId())) {
-                       // User does not exist
-                       throw new PersistenceException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
-               }
-
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
        @Override
        public void updateUserPersonalData (final User user) {
                // Trace message