]> git.mxchange.org Git - jjobs-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 21:53:13 +0000 (23:53 +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/jcontacts/contact/JobsContactSessionBean.java
src/java/org/mxchange/jcountry/data/JobsCountrySingletonBean.java
src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkSessionBean.java
src/java/org/mxchange/jmailee/model/delivery/JobsEmailDeliveryMessageBean.java
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/JobsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/JobsMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/JobsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/JobsPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/email_address/JobsEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/login/JobsUserLoginSessionBean.java
src/java/org/mxchange/jusercore/model/register/JobsUserRegistrationSessionBean.java
src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/JobsUserPasswordHistorySessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jusercore/model/user/password_history/LandingUserPasswordHistorySessionBean.java [deleted file]

index db7dce1fb6d27a5e500722595e8e32b9fcd2738f..8eafc5c3e9dfbe85774f426be652844093e54fc1 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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
 
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                        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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                        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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                        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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                }
 
                // 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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                // 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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                        // 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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                }
 
                // 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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
        @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 JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont
                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 f6d467890754411e2cd1155408a499ad8a9fc409..c75f469984b650eb68ec1fa672e88e8c4960138e 100644 (file)
@@ -42,6 +42,9 @@ public class JobsCountrySingletonBean extends BaseJobsDatabaseBean implements Co
 
        @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 JobsCountrySingletonBean extends BaseJobsDatabaseBean implements Co
                // 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 JobsCountrySingletonBean extends BaseJobsDatabaseBean implements Co
        @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 1eeeb9ac15daded8364b845e1503f22a312b2228..ee8ebb7430ed94df973f8ea8f246c5d73468faa3 100644 (file)
@@ -43,7 +43,7 @@ public class JobsResendLinkSessionBean extends BaseJobsDatabaseBean implements R
        @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 JobsResendLinkSessionBean extends BaseJobsDatabaseBean implements R
                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 48c4ec978991cdc4ad512b6c373e040eababab25..46b35a0e794e4a130b80522121734945ba4fbed4 100644 (file)
@@ -76,13 +76,13 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
        @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) {
@@ -98,7 +98,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                        // 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));
@@ -109,13 +109,13 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                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) {
@@ -142,7 +142,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                }
 
                // 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) {
@@ -187,7 +187,7 @@ public class JobsEmailDeliveryMessageBean extends BaseJobsDatabaseBean implement
                }
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace("onMessage - EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.onMessage - EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }
index b74f2484b19c9ad9403fa59bb82fe6dcb6f115c1..938b1383a15a3d732f85dcd29e878c00cc115816 100644 (file)
@@ -38,7 +38,7 @@ public class JobsAdminMobileProviderSessionBean extends BaseJobsDatabaseBean imp
        @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 JobsAdminMobileProviderSessionBean extends BaseJobsDatabaseBean imp
                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 80fe7f1780d6052c9a3a971b1bd9161e20b9c00a..3ac72b90d58424028406ec759afc786edfdc6616 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 JobsMobileProviderSingletonBean extends BaseJobsDatabaseBean implem
        @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 16ac9a658286be72e4dab71c8c8a0cbbab2172eb..bc7292836b7a0beab256e4cbba6d44a5b6233506 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
        @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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                }
 
                // 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 JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean imple
                        // 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 0766c46f8f352acd06e87a90b61f2d320c7d0ea1..4249eed13375543e78db16cea1f9e4e13518f89e 100644 (file)
@@ -46,6 +46,9 @@ public class JobsPhoneSessionBean extends BaseJobsDatabaseBean implements PhoneS
 
        @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 JobsPhoneSessionBean extends BaseJobsDatabaseBean implements PhoneS
                        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 faff72db974ce34edabde2df010a7197017a192d..6ddb919a105ffa0d10975075cdc210bea15fbb4a 100644 (file)
@@ -60,7 +60,7 @@ public class JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
        @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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
                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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
        @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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
                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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
                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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
                }
 
                // 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 JobsEmailChangeSessionBean extends BaseJobsDatabaseBean implements
        @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 dd74ed123b258ff2f005fc4b14d64e93cc378c2a..b41d509c813d98b664d548d932cc381027232313 100644 (file)
@@ -59,7 +59,7 @@ public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
        @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 JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
                }
 
                // 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;
@@ -118,7 +118,7 @@ public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
         * <p>
         * @param container Container instance holding the user instance and
         * unencrypted password
-        * @param updatedUser User instance found for given user name
+        * @param updatedUser Updated user instance found for given user name
         * <p>
         * @return Whether the password matches
         */
@@ -138,4 +138,5 @@ public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
                // Is it the same same password?
                return UserUtils.ifPasswordMatches(container, updatedUser);
        }
+
 }
index 84677d9b4f16ae4894caacff1aa2fd4020d902f3..35be0ab3113fe97482e44d9b73ea28f8615e2511 100644 (file)
@@ -56,7 +56,7 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
        @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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
                                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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
                }
 
                // 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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
        @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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
        @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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
        @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 JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
                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 cd0737b25b2fdc93440f48f5df8cc382f239f4df..2cab791b97d1fc06889f452e65e512622f205fd6 100644 (file)
@@ -73,7 +73,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                }
 
                // 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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                }
 
                // 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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                }
 
                // 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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                }
 
                // 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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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 JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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) {
@@ -629,8 +647,8 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                // Flush it to get id
                this.getEntityManager().flush();
 
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("linkUser: user.userId={0} - EXIT!", user.getUserId())); //NOI18N
+               // Log trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.linkUser: user={1} - EXIT!", this.getClass().getSimpleName(), user)); //NOI18N
 
                // Return updated instanc
                return user;
@@ -639,7 +657,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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) {
@@ -680,6 +698,9 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                // 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;
        }
@@ -687,7 +708,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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) {
@@ -723,7 +744,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                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;
@@ -732,7 +753,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
        @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) {
@@ -873,6 +894,9 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes
                        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/JobsUserPasswordHistorySessionBean.java b/src/java/org/mxchange/jusercore/model/user/password_history/JobsUserPasswordHistorySessionBean.java
new file mode 100644 (file)
index 0000000..853f2c2
--- /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 JobsUserPasswordHistorySessionBean extends BaseLandingDatabaseBean implements UserPasswordHistorySessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 395_767_546_195_014L;
+
+       /**
+        * Default constructor
+        */
+       public JobsUserPasswordHistorySessionBean () {
+       }
+
+       @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;
-       }
-
-}