]> git.mxchange.org Git - addressbook-mailer-ejb.git/commitdiff
Continued with logging: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Thu, 4 Aug 2016 12:36:20 +0000 (14:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 6 Aug 2016 20:55:08 +0000 (22:55 +0200)
- added simple class name to all log messages
- added possible missing log messages

Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
14 files changed:
src/java/org/mxchange/addressbook/beans/resendlink/AddressbookResendLinkSessionBean.java
src/java/org/mxchange/addressbook/mailer/model/delivery/AddressbookEmailDeliveryMessageBean.java
src/java/org/mxchange/jcontacts/contact/AddressbookContactSessionBean.java
src/java/org/mxchange/jcountry/data/AddressbookCountrySingletonBean.java
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/AddressbookAdminContactPhoneSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/email_address/AddressbookEmailChangeSessionBean.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/AddressbookUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/AddressbookUserPasswordHistorySessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java [deleted file]

index 3c5e743c24cea79af777f77d40b2f8ac715abf97..016d503576beec5bbca20fcff2f19e60e5cc7c10 100644 (file)
@@ -43,7 +43,7 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookDatabaseBea
        @Override
        public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("resendConfirmationLink: user={0},locale={1},baseUrl={2} - CALLED!", user, locale, baseUrl)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: user={1},locale={2},baseUrl={3} - CALLED!", this.getClass().getSimpleName(), user, locale, baseUrl)); //NOI18N
 
                // The user instance should be valid
                if (null == user) {
@@ -84,7 +84,7 @@ public class AddressbookResendLinkSessionBean extends BaseAddressbookDatabaseBea
                this.sendEmail("Resend confirmation link", "resend_confirmation_link", emailAddress, user, baseUrl); //NOI18N
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace("resendConfirmationLink: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }
index d4cada858514f872d8f4646048a31a9bf575dc13..1222a93ffe4d3ac2d9edf3c113c9cbc854ca2e22 100644 (file)
@@ -71,13 +71,13 @@ public class AddressbookEmailDeliveryMessageBean extends BaseAddressbookDatabase
        @PostConstruct
        public void init () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("init: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.init: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Try to load bundle
                ResourceBundle bundle = ResourceBundle.getBundle(this.configFile);
 
                // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("init: bundle={0}", bundle)); //NOI18N
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.init: bundle={1}", this.getClass().getSimpleName(), bundle)); //NOI18N
 
                // The bunble should be valid
                if (null == bundle) {
@@ -93,7 +93,7 @@ public class AddressbookEmailDeliveryMessageBean extends BaseAddressbookDatabase
                        // Loop through all
                        for (final String key : bundle.keySet()) {
                                // Log debug message
-                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("init: key={0}", key)); //NOI18N
+                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.init: key={1}", this.getClass().getSimpleName(), key)); //NOI18N
 
                                // Get string from bundle and set it in properties
                                properties.put(key, bundle.getString(key));
@@ -104,13 +104,13 @@ public class AddressbookEmailDeliveryMessageBean extends BaseAddressbookDatabase
                this.mailer.init(properties);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("init: EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.init: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
        @Override
        public void onMessage (final Message message) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("onMessage: message={0} - CALLED!", message)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage: message={1} - CALLED!", this.getClass().getSimpleName(), message)); //NOI18N
 
                // The parameter should be valid
                if (null == message) {
@@ -137,7 +137,7 @@ public class AddressbookEmailDeliveryMessageBean extends BaseAddressbookDatabase
                }
 
                // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("onMessage: serializable={0}", serializable)); //NOI18N
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.onMessage: serializable={1}", this.getClass().getSimpleName(), serializable)); //NOI18N
 
                // Okay, is it the right interface?
                if (null == serializable) {
@@ -182,7 +182,7 @@ public class AddressbookEmailDeliveryMessageBean extends BaseAddressbookDatabase
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("onMessage - EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage - EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }
index b60576ba8d3466f81db1e24527d360e2f5eb4e8d..111ef15441d76802bc5616da7a94ccf88c2456fd 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jcontacts.contact;
 
 import java.text.MessageFormat;
+import java.util.GregorianCalendar;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -49,13 +50,41 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
 
        @Override
        public Contact addContact (final Contact contact) throws ContactAlreadyAddedException {
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addContact: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
+
+               // Is the instance set?
+               if (null == contact) {
+                       // Throw NPE
+                       throw new NullPointerException("contact is null"); //NOI18N
+               } else if (contact.getContactId() != null) {
+                       // Should be null
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} - is not null", contact.getContactId())); //NOI18N
+               }
+
+               // Set created timestamp
+               contact.setContactCreated(new GregorianCalendar());
+
+               // Set all created timestamps, if instance is there
+               this.setAllContactPhoneEntriesCreated(contact);
+
+               // Persist it
+               this.getEntityManager().persist(contact);
+
+               // Flush it to get contactId set
+               this.getEntityManager().flush();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addContact: contact.contactId={1} after persisting - EXIT!", this.getClass().getSimpleName(), contact.getContactId())); //NOI18N
+
+               // Return it
+               return contact;
        }
 
        @Override
        public Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactByEmailAddress: emailAddress={0} - CALLED!", emailAddress)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
 
                // The parameter must be valid
                if (null == emailAddress) {
@@ -81,14 +110,14 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                        contact = (Contact) query.getSingleResult();
 
                        // Log trace message
-                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactByEmailAddress: Found contact={0}", contact)); //NOI18N
+                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: Found contact={1}", this.getClass().getSimpleName(), contact)); //NOI18N
                } catch (final NoResultException ex) {
                        // No result found
                        throw new ContactNotFoundException(emailAddress, ex);
                }
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactByEmailAddress: contact={0} - EXIT!", contact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactByEmailAddress: contact={1} - EXIT!", this.getClass().getSimpleName(), contact)); //NOI18N
 
                // Return found instance
                return contact;
@@ -97,7 +126,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @Override
        public Contact findContactById (final Long contactId) throws ContactNotFoundException {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactById: contactId={0} - CALLED!", contactId)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactById: contactId={1} - CALLED!", this.getClass().getSimpleName(), contactId)); //NOI18N
 
                // The parameter must be valid
                if (null == contactId) {
@@ -123,14 +152,14 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                        contact = (Contact) query.getSingleResult();
 
                        // Log trace message
-                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactById: Found contact={0}", contact)); //NOI18N
+                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactById: Found contact={1}", this.getClass().getSimpleName(), contact)); //NOI18N
                } catch (final NoResultException ex) {
                        // No result found
                        throw new ContactNotFoundException(contactId, ex);
                }
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactById: contact={0} - EXIT!", contact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findContactById: contact={1} - EXIT!", this.getClass().getSimpleName(), contact)); //NOI18N
 
                // Return found instance
                return contact;
@@ -140,7 +169,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @SuppressWarnings ("unchecked")
        public List<Contact> getAllContacts () {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace("getAllContacts - CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getAllContacts - CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Create query instance
                Query query = this.getEntityManager().createNamedQuery("AllContacts", UserContact.class); //NOI18N
@@ -149,7 +178,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                List<Contact> contacts = query.getResultList();
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getAllContacts: contacts.size()={0} - EXIT!", contacts.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getAllContacts: contacts.size()={1} - EXIT!", this.getClass().getSimpleName(), contacts.size())); //NOI18N
 
                // Return it
                return contacts;
@@ -159,7 +188,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @SuppressWarnings ("unchecked")
        public List<String> getEmailAddressList () {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace("getEmailAddressList - CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList - CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Create query instance
                Query query = this.getEntityManager().createNamedQuery("AllContactEmailAddresses", String.class); //NOI18N
@@ -168,7 +197,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                List<String> emailAddresses = query.getResultList();
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getEmailAddressList: emailAddresses.size()={0} - EXIT!", emailAddresses.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: emailAddresses.size()={1} - EXIT!", this.getClass().getSimpleName(), emailAddresses.size())); //NOI18N
 
                // Return it
                return emailAddresses;
@@ -177,15 +206,15 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @Override
        public boolean isEmailAddressRegistered (final String emailAddress) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressRegistered: emailAddress={0} - CALLED!", emailAddress)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
 
                // The email address should be valid
                if (null == emailAddress) {
                        // Is null
-                       throw new NullPointerException("emailAddress is null");
+                       throw new NullPointerException("emailAddress is null"); //NOI18N
                } else if (emailAddress.isEmpty()) {
                        // Is empty
-                       throw new IllegalArgumentException("emailAddress is empty");
+                       throw new IllegalArgumentException("emailAddress is empty"); //NOI18N
                }
 
                // Default is not found
@@ -196,7 +225,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                        Contact contact = this.findContactByEmailAddress(emailAddress);
 
                        // Log debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("isEmailAddressRegistered: Found contact={0} for emailAddress={1}", contact, emailAddress));
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isEmailAddressRegistered: Found contact={1} for emailAddress={2}", this.getClass().getSimpleName(), contact, emailAddress)); //NOI18N
 
                        // It is found ...
                        isFound = true;
@@ -205,7 +234,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                }
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressRegistered: isFound={0} - EXIT!", isFound));
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: isFound={1} - EXIT!", this.getClass().getSimpleName(), isFound)); //NOI18N
 
                // Return status
                return isFound;
@@ -214,7 +243,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @Override
        public Contact lookupContact (final Contact contact) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isContactFound: contact={0} - CALLED!", contact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isContactFound: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
 
                // Parameter should be valid
                if (null == contact) {
@@ -239,7 +268,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                // Is the list empty?
                if (contacts.isEmpty()) {
                        // Then abort here
-                       this.getLoggerBeanLocal().logTrace("isContactFound: No contacts registered, returning 'false' ..."); //NOI18N
+                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isContactFound: No contacts registered, returning NULL ...", this.getClass().getSimpleName())); //NOI18N
                        return null;
                }
 
@@ -254,7 +283,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                        // Is same contact?
                        if ((Objects.equals(contact, next)) || (ContactUtils.isSameContact(contact, next))) {
                                // Debug message
-                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("isContactFound: Found same contact, id={0}", next.getContactId())); //NOI18N
+                               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isContactFound: Found same contact: contactId={1}", this.getClass().getSimpleName(), next.getContactId())); //NOI18N
 
                                // Found it
                                foundContact = next;
@@ -263,7 +292,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isContactFound: foundContact={0} - EXIT!", foundContact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isContactFound: foundContact={1} - EXIT!", this.getClass().getSimpleName(), foundContact)); //NOI18N
 
                // Return found contact
                return foundContact;
@@ -272,7 +301,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @Override
        public Contact updateContactData (final Contact contact, final boolean isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateContactData: contact={0},isCellphoneUnlinked={1},isLandlineUnlinked={2},isFaxUnlinked={3} - CALLED!", contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: contact={1},isCellphoneUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED!", this.getClass().getSimpleName(), contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
 
                // The contact instance must be valid
                if (null == contact) {
@@ -293,7 +322,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                Contact detachedContact = this.mergeContactData(contact);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateContactData: detachedContact={0} - EXIT!", detachedContact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
 
                // Return it
                return detachedContact;
@@ -302,7 +331,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        @Override
        public Contact updateContactData (final Contact contact) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateContactData: contact={0} - CALLED!", contact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
 
                // The contact instance must be valid
                if (null == contact) {
@@ -325,7 +354,7 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
                Contact detachedContact = this.updateContactData(contact, isCellphoneUnlinked, isLandLineUnlinked, isFaxUnlinked);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateContactData: detachedContact={0} - EXIT!", detachedContact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
 
                // Return it
                return detachedContact;
index 9358bcf85555edf90920459f2478b0c24f32c599..d3d196e9e87491f197e1d6edb4f02a756794d2a9 100644 (file)
@@ -42,6 +42,9 @@ public class AddressbookCountrySingletonBean extends BaseDatabaseBean implements
 
        @Override
        public Country addCountry (final Country country) throws CountryAlreadyAddedException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addCountry: country={1} - CALLED!", this.getClass().getSimpleName(), country)); //NOI18N
+
                // Is it already there?
                if (null == country) {
                        // Throw NPE
@@ -69,6 +72,9 @@ public class AddressbookCountrySingletonBean extends BaseDatabaseBean implements
                // Flush it to get id number back, maybe it is directly needed?
                this.getEntityManager().flush();
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addCountry: country={1} - EXIT!", this.getClass().getSimpleName(), country)); //NOI18N
+
                // Return updated instance
                return country;
        }
@@ -76,11 +82,20 @@ public class AddressbookCountrySingletonBean extends BaseDatabaseBean implements
        @Override
        @SuppressWarnings ("unchecked")
        public List<Country> allCountries () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allCountries: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
                // Init query
                Query query = this.getEntityManager().createNamedQuery("AllCountries", CountryData.class); //NOI18N
 
+               // Get list
+               List<Country> countries = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allCountries: countries.size()={1} - EXIT!", this.getClass().getSimpleName(), countries.size())); //NOI18N
+
                // Return it
-               return query.getResultList();
+               return countries;
        }
 
        /**
index 6c6297ac4541a11e84692bbb3f7779906c576c3c..cb7339c16f0c1628d5f1c16d2c52dbbc9239a852 100644 (file)
@@ -38,7 +38,7 @@ public class AddressbookAdminMobileProviderSessionBean extends BaseDatabaseBean
        @Override
        public MobileProvider addMobileProvider (final MobileProvider mobileProvider) throws MobileProviderAlreadyAddedException {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("addMobileProvider: mobileProvider={0} - CALLED!", mobileProvider)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addMobileProvider: mobileProvider={1} - CALLED!", this.getClass().getSimpleName(), mobileProvider)); //NOI18N
 
                // Is the instance valid?
                if (null == mobileProvider) {
@@ -80,7 +80,7 @@ public class AddressbookAdminMobileProviderSessionBean extends BaseDatabaseBean
                this.getEntityManager().flush();
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("addMobileProvider: mobileProvider.providerId={0} - EXIT!", mobileProvider.getProviderId())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addMobileProvider: mobileProvider.providerId={1} - EXIT!", this.getClass().getSimpleName(), mobileProvider.getProviderId())); //NOI18N
 
                // Return updated
                return mobileProvider;
index 7fd7d89d83e7505b9bd158684f26901b5d26f3d9..28b118df10caf8b9b2a80e88ed5fc88079b87349 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.mxchange.jphone.phonenumbers.mobileprovider;
 
+import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
@@ -39,11 +40,20 @@ public class AddressbookMobileProviderSingletonBean extends BaseDatabaseBean imp
        @Override
        @SuppressWarnings ("unchecked")
        public List<MobileProvider> allMobileProvider () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileProvider: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
                // Init query
                Query query = this.getEntityManager().createNamedQuery("AllMobileProvider", CellphoneProvider.class); //NOI18N
 
+               // Get list from it
+               List<MobileProvider> mobileProviders = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileProvider: mobileProviders.size()={1} - EXIT!", this.getClass().getSimpleName(), mobileProviders.size())); //NOI18N
+
                // Return it
-               return query.getResultList();
+               return mobileProviders;
        }
 
 }
index 6f580b56a192546faac8694b284661187ddc1963..fbb36069866cb8f2ffbc4f1cd1310a35b5700a3a 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jphone.phonenumbers.phone;
 
 import java.text.MessageFormat;
+import java.util.LinkedList;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
@@ -43,6 +44,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseDatabaseBean im
        @Override
        @SuppressWarnings ("unchecked")
        public List<Contact> allContacts (final DialableCellphoneNumber cellPhone) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allContacts: cellPhone={1} - CALLED!", this.getClass().getSimpleName(), cellPhone)); //NOI18N
+
                // The parameter should be valid
                if (null == cellPhone) {
                        // Throw NPE
@@ -56,7 +60,7 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseDatabaseBean im
                }
 
                // Init list instance
-               List<Contact> contacts = null;
+               List<Contact> contacts = new LinkedList<>();
 
                // Get query object from all found contact-cellphone links
                Query query = this.getEntityManager().createNamedQuery("AllContactsByCellphone", UserContact.class); //NOI18N
@@ -71,6 +75,9 @@ public class AddressbookAdminContactPhoneSessionBean extends BaseDatabaseBean im
                        // No results found
                }
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allContacts: contacts.size()={1} - EXIT!", this.getClass().getSimpleName(), contacts.size())); //NOI18N
+
                // Return list
                return contacts;
        }
index 96ca2e335ec20b2530f6c7c10c947c46b7281ed3..5255d640e420a7220eb400e031b8330e67c99ad5 100644 (file)
@@ -46,6 +46,9 @@ public class AddressbookPhoneSessionBean extends BaseDatabaseBean implements Pho
 
        @Override
        public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphoneId={1} - CALLED!", this.getClass().getSimpleName(), cellphoneId)); //NOI18N
+
                // The id number should be valid
                if (null == cellphoneId) {
                        // Throw NPE
@@ -73,6 +76,9 @@ public class AddressbookPhoneSessionBean extends BaseDatabaseBean implements Pho
                        throw new PhoneEntityNotFoundException(cellphoneId, ex);
                }
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), cellphone)); //NOI18N
+
                // Return found instance
                return cellphone;
        }
index 9bde86501ce249cffce88219d59ffa131a9a9dd3..503b7ed8e363841e25448078a07522bd9e4ed9ab 100644 (file)
@@ -60,7 +60,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
        @SuppressWarnings ("unchecked")
        public List<String> allQueuedAddresses () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("allQueuedAddressesAsList: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allQueuedAddresses: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Get named query
                Query query = this.getEntityManager().createNamedQuery("AllEmailAddressChanges", String.class); //NOI18N
@@ -69,7 +69,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
                List<String> emailAddresses = query.getResultList();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("allQueuedAddressesAsList: emailAddresses.size()={0} - EXIT!", emailAddresses.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allQueuedAddresses: emailAddresses.size()={1} - EXIT!", this.getClass().getSimpleName(), emailAddresses.size())); //NOI18N
 
                // Return it
                return emailAddresses;
@@ -78,7 +78,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
        @Override
        public void enqueueEmailAddressForChange (final ChangeableEmailAddress emailChange, final String baseUrl) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("enqueueEmailAddressForChange: emailChange={0},baseUrl={1} - CALLED!", emailChange, baseUrl)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.enqueueEmailAddressForChange: emailChange={1},baseUrl={2} - CALLED!", this.getClass().getSimpleName(), emailChange, baseUrl)); //NOI18N
 
                // Email address change should be valid
                if (null == emailChange) {
@@ -109,8 +109,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
                this.generateSecureHash(emailChange);
 
                // Persist it
-               //this.getEntityManager().persist(emailChange);
-
+               //@TODO Fix email delivery then allow this: this.getEntityManager().persist(emailChange);
                // Init variable
                Address emailAddress;
 
@@ -126,13 +125,13 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
                this.sendEmail("Email change", "email_change", emailAddress, emailChange.getEmailChangeUser(), baseUrl); //NOI18N
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("enqueueEmailAddressForChange - EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.enqueueEmailAddressForChange - EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
        @Override
        public boolean isEmailAddressEnqueued (final String emailAddress) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressEnqueued: emailAddress={0} - CALLED!", emailAddress)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressEnqueued: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
 
                // Create query instance
                Query query = this.getEntityManager().createNamedQuery("SearchEmailChangeByEmail"); //NOI18N
@@ -156,7 +155,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressEnqueued: isFound={0} - EXIT!", isFound)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressEnqueued: isFound={1} - EXIT!", this.getClass().getSimpleName(), isFound)); //NOI18N
 
                // Return it
                return isFound;
@@ -165,7 +164,7 @@ public class AddressbookEmailChangeSessionBean extends BaseAddressbookDatabaseBe
        @Override
        public void updateEmailAddress (final ChangeableEmailAddress emailAddress) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateEmailAddress: emailAddress={0} - CALLED!", emailAddress)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateEmailAddress: emailAddress={1} - CALLED!", this.getClass().getSimpleName(), emailAddress)); //NOI18N
 
                // Email address change should be valid
                if (null == emailAddress) {
index e83693c92a57b89623801fa4e4f891129b46721e..5094647c53ef835840832b013875ebfdc399ed17 100644 (file)
@@ -59,7 +59,7 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
        @Override
        public User validateUserAccountStatus (final LoginContainer container) throws UserNotFoundException, UserStatusLockedException, UserStatusUnconfirmedException, UserPasswordMismatchException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: container={0} - CALLED!", container)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: container={1} - CALLED!", this.getClass().getSimpleName(), container)); //NOI18N
 
                // Check some beans
                assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
@@ -105,7 +105,7 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: updatedUser={0} - EXIT!", updatedUser)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N
 
                // Return it
                return updatedUser;
@@ -116,9 +116,9 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
         * not match, the first one is the one from the calling bean/controller, the
         * second is the from database.
         * <p>
-        * @param container   Container instance holding the user instance and
-        *                    unencrypted password
-        * @param updatedUser User instance found for given user name
+        * @param container Container instance holding the user instance and
+        * unencrypted password
+        * @param updatedUser Updated user instance found for given user name
         * <p>
         * @return Whether the password matches
         */
@@ -138,4 +138,5 @@ public class AddressbookUserLoginSessionBean extends BaseDatabaseBean implements
                // Is it the same same password?
                return UserUtils.ifPasswordMatches(container, updatedUser);
        }
+
 }
index e9de1d585032e4198b2b656b8014a46844ee3e47..5bec678b2c4d0e50d50f53a11568e7788e061dd0 100644 (file)
@@ -56,7 +56,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
        @Override
        public String generateConfirmationKey (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("generateConfirmationKey: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.generateConfirmationKey: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -84,7 +84,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
                                Contact contact = (Contact) query.getSingleResult();
 
                                // Warning message
-                               this.getLoggerBeanLocal().logWarning(MessageFormat.format("generateConfirmationKey: key {0} already found: contact.contactId={1}", key, contact.getContactId())); //NOI18N
+                               this.getLoggerBeanLocal().logWarning(MessageFormat.format("{0}.generateConfirmationKey: key {1} already found: contact.contactId={2}", this.getClass().getSimpleName(), key, contact.getContactId())); //NOI18N
                        } catch (final NoResultException ex) {
                                // Not found, normal case
                                confirmationKey = key;
@@ -93,7 +93,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
                }
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("generateConfirmationKey: confirmationKey={0} - EXIT!", confirmationKey)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.generateConfirmationKey: confirmationKey={1} - EXIT!", this.getClass().getSimpleName(), confirmationKey)); //NOI18N
 
                // Return it
                return confirmationKey;
@@ -102,7 +102,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
        @Override
        public boolean isEmailAddressRegistered (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressRegistered: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Check bean
                assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
@@ -120,7 +120,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
        @Override
        public boolean isUserNameRegistered (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isUserNameRegistered: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isUserNameRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Check bean
                assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
@@ -138,7 +138,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
        @Override
        public User registerUser (final User user, final String baseUrl) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("registerUser: user={0},baseUrl={1} - CALLED!", user, baseUrl)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: user={1},baseUrl={2} - CALLED!", this.getClass().getSimpleName(), user, baseUrl)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -183,7 +183,7 @@ public class AddressbookUserRegistrationSessionBean extends BaseAddressbookDatab
                this.sendEmail("Registration", "registration", emailAddress, addedUser, baseUrl); //NOI18N
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("registerUser: addedUser={0},addedUser.userId={1} - EXIT!", addedUser, addedUser.getUserId())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.registerUser: addedUser={1},addedUser.userId={2} - EXIT!", this.getClass().getSimpleName(), addedUser, addedUser.getUserId())); //NOI18N
 
                // Return it
                return addedUser;
index eb3b28dd5780e0ddadb1e71e8b04d2f1bf027e67..30306adfc854a85976e6dd0aada1d978ae3b9135 100644 (file)
@@ -73,7 +73,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("addUser: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUser: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -107,7 +107,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                this.getEntityManager().flush();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("addUser: user={0},user.id={1} - EXIT!", user, user.getUserId())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addUser: user={1},user.userId={2} - EXIT!", this.getClass().getSimpleName(), user, user.getUserId())); //NOI18N
 
                // Return it
                return user;
@@ -117,7 +117,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @SuppressWarnings ("unchecked")
        public List<User> allMemberPublicVisibleUsers () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("allMemberPublicVisibleUsers: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMemberPublicVisibleUsers: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Get named query
                Query query = this.getEntityManager().createNamedQuery("AllMemberPublicUsers", LoginUser.class); //NOI18N
@@ -131,7 +131,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                List<User> users = query.getResultList();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("allMemberPublicVisibleUsers: users.size()={0} - EXIT!", users.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMemberPublicVisibleUsers: users.size()={1} - EXIT!", this.getClass().getSimpleName(), users.size())); //NOI18N
 
                // Return full list
                return users;
@@ -141,7 +141,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @SuppressWarnings ("unchecked")
        public List<User> allPublicUsers () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("allPublicUsers: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allPublicUsers: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Get named query
                Query query = this.getEntityManager().createNamedQuery("AllPublicUsers", LoginUser.class); //NOI18N
@@ -154,7 +154,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                List<User> users = query.getResultList();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("allPublicUsers: users.size()={0} - EXIT!", users.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allPublicUsers: users.size()={1} - EXIT!", this.getClass().getSimpleName(), users.size())); //NOI18N
 
                // Return full list
                return users;
@@ -164,7 +164,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @SuppressWarnings ("unchecked")
        public List<User> allUsers () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("allUsers: CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsers: CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Get named query
                Query query = this.getEntityManager().createNamedQuery("AllUsers", LoginUser.class); //NOI18N
@@ -173,7 +173,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                List<User> users = query.getResultList();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("allUsers: users.size()={0} - EXIT!", users.size())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsers: users.size()={1} - EXIT!", this.getClass().getSimpleName(), users.size())); //NOI18N
 
                // Return full list
                return users;
@@ -182,7 +182,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User confirmAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusLockedException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("confirmAccount: user={0},baseUrl={1} - CALLED!", user, baseUrl)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.confirmAccount: user={1},baseUrl={2} - CALLED!", this.getClass().getSimpleName(), user, baseUrl)); //NOI18N
 
                // Parameter must be valid
                if (null == user) {
@@ -228,7 +228,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                this.sendEmail("Account confirmed", "account_confirmed", emailAddress, updatedUser, baseUrl); //NOI18N
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("confirmAccount: updatedUser={0} - EXIT!", updatedUser)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.confirmAccount: updatedUser={1} - EXIT!", this.getClass().getSimpleName(), updatedUser)); //NOI18N
 
                // Return updated instance
                return updatedUser;
@@ -237,7 +237,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User fillUserData (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("fillUserData: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fillUserData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -264,7 +264,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("fillUserData: foundUser={0} - EXIT!", foundUser)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fillUserData: foundUser={1} - EXIT!", this.getClass().getSimpleName(), foundUser)); //NOI18N
 
                // Return prepared instance
                return foundUser;
@@ -273,7 +273,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User findUserById (final Long userId) throws UserNotFoundException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findUserById: userId={0} - CALLED!", userId)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findUserById: userId={1} - CALLED!", this.getClass().getSimpleName(), userId)); //NOI18N
 
                // Is the parameter valid?
                if (null == userId) {
@@ -297,7 +297,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                User user = (User) query.getSingleResult();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("findUserById: user={0} - EXIT!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findUserById: user={1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Return found user
                return user;
@@ -306,7 +306,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public String generateRandomUserName () {
                // Trace message
-               this.getLoggerBeanLocal().logTrace("generateRandomUserName - CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.generateRandomUserName - CALLED!", this.getClass().getSimpleName())); //NOI18N
 
                // Get full list
                List<String> userList = this.getUserNameList();
@@ -321,7 +321,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("generateRandomUserName: userName={0} - EXIT!", userName)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.generateRandomUserName: userName={1} - EXIT!", this.getClass().getSimpleName(), userName)); //NOI18N
 
                // Found one, so return it
                return userName;
@@ -330,12 +330,18 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        @SuppressWarnings ("unchecked")
        public List<String> getEmailAddressList () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
                // Get query
                Query query = this.getEntityManager().createNamedQuery("AllEmailAddresses", String.class); //NOI18N
 
                // Get result list
                List<String> emailAddressList = query.getResultList();
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getEmailAddressList: emailAddressList.size()={1} - EXIT!", this.getClass().getSimpleName(), emailAddressList.size())); //NOI18N
+
                // Return it
                return emailAddressList;
        }
@@ -343,12 +349,18 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        @SuppressWarnings ("unchecked")
        public List<String> getUserNameList () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserNameList: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
                // Get query
                Query query = this.getEntityManager().createNamedQuery("AllUserNames", String.class); //NOI18N
 
                // Get result list
                List<String> userNameList = query.getResultList();
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserNameList: userNameList.size()={1} - EXIT!", this.getClass().getSimpleName(), userNameList.size())); //NOI18N
+
                // Return it
                return userNameList;
        }
@@ -356,7 +368,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public boolean ifUserExists (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserExists: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserExists: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // userId should not be null
                if (null == user) {
@@ -397,7 +409,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserExists: Found user {0} - EXIT!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserExists: Found user {1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Found it
                return true;
@@ -406,7 +418,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public boolean ifUserIdExists (final Long userId) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserIdExists: userId={0} - CALLED!", userId)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserIdExists: userId={1} - CALLED!", this.getClass().getSimpleName(), userId)); //NOI18N
 
                // userId should not be null
                if (null == userId) {
@@ -428,10 +440,10 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        User dummy = (User) query.getSingleResult();
 
                        // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserIdExists: dummy.id={0} found.", dummy.getUserId())); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.ifUserIdExists: dummy.userId={1} found.", this.getClass().getSimpleName(), dummy.getUserId())); //NOI18N
                } catch (final NoResultException ex) {
                        // Log it
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserIdExists: getSingleResult() returned no result: {0}", ex)); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.ifUserIdExists: getSingleResult() returned no result: {1}", this.getClass().getSimpleName(), ex)); //NOI18N
 
                        // User name does not exist
                        return false;
@@ -444,7 +456,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserIdExists: Found user id {0} - EXIT!", userId)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserIdExists: Found userId={1} - EXIT!", this.getClass().getSimpleName(), userId)); //NOI18N
 
                // Found it
                return true;
@@ -453,7 +465,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public boolean ifUserNameExists (final String userName) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserNameExists: userName={0} - CALLED!", userName)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserNameExists: userName={1} - CALLED!", this.getClass().getSimpleName(), userName)); //NOI18N
 
                // userId should not be null
                if (null == userName) {
@@ -475,17 +487,17 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        User dummy = (User) query.getSingleResult();
 
                        // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserNameExists: dummy.id={0} found.", dummy.getUserId())); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.ifUserNameExists: dummy.userId={1} found.", this.getClass().getSimpleName(), dummy.getUserId())); //NOI18N
                } catch (final NoResultException ex) {
                        // Log it
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserNameExists: getSingleResult() returned no result: {0}", ex)); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.ifUserNameExists: getSingleResult() returned no result: {1}", this.getClass().getSimpleName(), ex)); //NOI18N
 
                        // User name does not exist
                        return false;
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserNameExists: Found user name {0} - EXIT!", userName)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.ifUserNameExists: Found userName={1} - EXIT!", this.getClass().getSimpleName(), userName)); //NOI18N
 
                // Found it
                return true;
@@ -494,7 +506,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public boolean isEmailAddressRegistered (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressRegistered: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -513,10 +525,10 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        User dummy = (User) query.getSingleResult();
 
                        // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("isEmailAddressRegistered: dummy.id={0} found.", dummy.getUserId())); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isEmailAddressRegistered: dummy.userId={1} found.", this.getClass().getSimpleName(), dummy.getUserId())); //NOI18N
                } catch (final NoResultException ex) {
                        // Log it
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("isEmailAddressRegistered: getSingleResult() returned no result: {0}", ex)); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isEmailAddressRegistered: getSingleResult() returned no result: {1}", this.getClass().getSimpleName(), ex)); //NOI18N
 
                        // Email address does not exist
                        return false;
@@ -528,6 +540,9 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        throw ex;
                }
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: Returning true ... - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
                // Found it
                return true;
        }
@@ -535,7 +550,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public boolean isUserNameRegistered (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("isUserNameRegistered: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isUserNameRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -554,10 +569,10 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        User dummy = (User) query.getSingleResult();
 
                        // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("isUserNameRegistered: dummy.id={0} found.", dummy.getUserId())); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isUserNameRegistered: dummy.userId={1} found.", this.getClass().getSimpleName(), dummy.getUserId())); //NOI18N
                } catch (final NoResultException ex) {
                        // Log it
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("isUserNameRegistered: getSingleResult() returned no result: {0}", ex)); //NOI18N
+                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isUserNameRegistered: getSingleResult() returned no result: {1}", this.getClass().getSimpleName(), ex)); //NOI18N
 
                        // User name does not exist
                        return false;
@@ -569,6 +584,9 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        throw ex;
                }
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isUserNameRegistered: Returning true ... - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
                // Found it
                return true;
        }
@@ -576,7 +594,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("linkUser: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkUser: user={0} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -621,7 +639,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                this.getEntityManager().flush();
 
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("linkUser: user={0} - EXIT!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkUser: user={1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Return updated instanc
                return user;
@@ -630,7 +648,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User updateUserData (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateUserData: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -671,6 +689,9 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                // Set as updated
                detachedUser.setUserUpdated(new GregorianCalendar());
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: detachedUser={1} - CALLED!", this.getClass().getSimpleName(), detachedUser)); //NOI18N
+
                // Return updated instance
                return detachedUser;
        }
@@ -678,7 +699,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public PasswordHistory updateUserPassword (final User user) throws UserNotFoundException, UserStatusUnconfirmedException, UserStatusLockedException {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateUserPassword: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPassword: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -714,7 +735,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                this.getEntityManager().flush();
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateUserPassword: entry.userPasswordHistoryId={0} - EXIT!", entry.getUserPasswordHistoryId())); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPassword: entry.userPasswordHistoryId={1} - EXIT!", this.getClass().getSimpleName(), entry.getUserPasswordHistoryId())); //NOI18N
 
                // Return it
                return entry;
@@ -723,7 +744,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
        @Override
        public User updateUserPersonalData (final User user) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateUserPersonalData: user={0} - CALLED!", user)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPersonalData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // user should not be null
                if (null == user) {
@@ -864,6 +885,9 @@ public class AddressbookUserSessionBean extends BaseAddressbookDatabaseBean impl
                        detachedContact.setContactLandLineNumber(detachedLandLine);
                }
 
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPersonalData: entry.detachedUser={1} - EXIT!", this.getClass().getSimpleName(), detachedUser)); //NOI18N
+
                // Return updated user instance
                return detachedUser;
        }
diff --git a/src/java/org/mxchange/jusercore/model/user/password_history/AddressbookUserPasswordHistorySessionBean.java b/src/java/org/mxchange/jusercore/model/user/password_history/AddressbookUserPasswordHistorySessionBean.java
new file mode 100644 (file)
index 0000000..81b1d5b
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016 Cho-Time GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jusercore.model.user.password_history;
+
+import de.chotime.landingpage.database.BaseLandingDatabaseBean;
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A user password history EJB
+ * <p>
+ * @author Roland Haeder<rhaeder@cho-time.de>
+ */
+@Stateless (name = "userPasswordHistory", description = "A stateless EJB for user's password history. This bean does return the full user's password history and not limited. The application then needs to limit it to it's purpose.")
+public class AddressbookUserPasswordHistorySessionBean extends BaseLandingDatabaseBean implements UserPasswordHistorySessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 395_767_546_195_014L;
+
+       /**
+        * Default constructor
+        */
+       public AddressbookUserPasswordHistorySessionBean () {
+       }
+
+       @Override
+       @SuppressWarnings ("unchecked")
+       public List<PasswordHistory> getUserPasswordHistory (final User user) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserPasswordHistory(): user={1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
+
+               // 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) {
+                       // Illegal id number
+                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not allowed.", user.getUserId())); //NOI18N
+               }
+
+               // Get named query
+               Query query = this.getEntityManager().createNamedQuery("AllUsersHistoryEntries", UserPasswordHistory.class); //NOI18N
+
+               // Set parameter
+               query.setParameter("user", user); //NOI18N
+
+               // Get full history
+               List<PasswordHistory> history = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserPasswordHistory(): history.size()={1} - EXIT !", this.getClass().getSimpleName(), history.size())); //NOI18N
+
+               // Return it
+               return history;
+       }
+
+}
diff --git a/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java b/src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java
deleted file mode 100644 (file)
index fa3461c..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2016 Cho-Time GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user.password_history;
-
-import de.chotime.landingpage.database.BaseLandingDatabaseBean;
-import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.persistence.Query;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A user password history EJB
- * <p>
- * @author Roland Haeder<rhaeder@cho-time.de>
- */
-@Stateless (name = "userPasswordHistory", description = "A stateless EJB for user's password history. This bean does return the full user's password history and not limited. The application then needs to limit it to it's purpose.")
-public class LandingUserPasswordHistorySessionBean extends BaseLandingDatabaseBean implements UserPasswordHistorySessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 395_767_546_195_014L;
-
-       /**
-        * Default constructor
-        */
-       public LandingUserPasswordHistorySessionBean () {
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<PasswordHistory> getUserPasswordHistory (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserPasswordHistory(): user={1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // 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) {
-                       // Illegal id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not allowed.", user.getUserId())); //NOI18N
-               }
-
-               // Get named query
-               Query query = this.getEntityManager().createNamedQuery("AllUsersHistoryEntries", UserPasswordHistory.class); //NOI18N
-
-               // Set parameter
-               query.setParameter("user", user); //NOI18N
-
-               // Get full history
-               List<PasswordHistory> history = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.getUserPasswordHistory(): history.size()={1} - EXIT !", this.getClass().getSimpleName(), history.size())); //NOI18N
-
-               // Return it
-               return history;
-       }
-
-}