import org.mxchange.jcontactsbusiness.model.employee.Employable;
import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
-import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
import org.mxchange.jcountry.model.data.Country;
}
/**
- * Get back a managed instance from given jobPosition
+ * Get back a managed instance from given job position
* <p>
* @param jobPosition Unmanaged/detached job position instance
* <p>
return managedHeadquarter;
}
- /**
- * Get back a managed instance from given job position
- * <p>
- * @param jobPosition Unmanaged/detached job position instance
- * <p>
- * @return Managed job position instance
- */
- protected JobPosition createManaged (final JobPosition jobPosition) {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
-
- // user should not be null
- if (null == jobPosition) {
- // Abort here
- throw new NullPointerException("jobPosition is null"); //NOI18N
- } else if (jobPosition.getJobPositionId() == null) {
- // Id is set
- throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
- } else if (jobPosition.getJobPositionId() < 1) {
- // Id is set
- throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
- }
-
- // Try to find it (should be there)
- final JobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
-
- // Should be there
- assert (managedJobPosition instanceof JobPosition) : "managedJobPosition is null"; //NOI18N
-
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
-
- // Return it
- return managedJobPosition;
- }
/**
* Get back a managed instance from given mobile provider
package org.mxchange.jaddressbook.model.addressbook;
import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.NoResultException;
}
// Add timestamp of creation
- addressbook.setAddressbookCreated(new GregorianCalendar());
+ addressbook.setAddressbookCreated(new Date());
// Persist it now
this.getEntityManager().persist(addressbook);
--- /dev/null
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * 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.jcontactsbusiness.model.headquarter;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.List;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A stateless session bean for administrative branch office purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "adminHeadquarter", description = "An administrative statless bean for handling branch office data (all)")
+public class AddressbookAdminHeadquarterSessionBean extends BaseAddressbookEnterpriseBean implements AdminHeadquarterSessionBeanRemote {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 58_467_386_571_701L;
+
+ /**
+ * General branch office bean
+ */
+ @EJB (lookup = "java:global/addressbook-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
+ private HeadquarterSessionBeanRemote headquarterBean;
+
+ /**
+ * Default constructor
+ */
+ public AddressbookAdminHeadquarterSessionBean () {
+ // Call super constructor
+ super();
+ }
+
+ @Override
+ public Headquarter addHeadquarter (final Headquarter headquarter) throws HeadquarterAlreadyAddedException {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+
+ // Validate parameter
+ if (null == headquarter) {
+ // Throw NPE
+ throw new NullPointerException("headquarter is null"); //NOI18N
+ } else if (headquarter.getHeadquarterId() instanceof Long) {
+ // Should not happen
+ throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
+ } else if (this.isHeadquarterFound(headquarter)) {
+ // Already added, abort here
+ throw new HeadquarterAlreadyAddedException(headquarter);
+ }
+
+ // Add created timestamp
+ headquarter.setHeadquarterCreated(new Date());
+
+ // Is user instance set?
+ if (headquarter.getHeadquarterUserOwner() instanceof User) {
+ // Get managed instance back
+ final User managedUser = this.createManaged(headquarter.getHeadquarterUserOwner());
+
+ // Set it back in branch office
+ headquarter.setHeadquarterUserOwner(managedUser);
+ }
+
+ // Is user instance set?
+ if (headquarter.getHeadquarterCountry() instanceof Country) {
+ // Get managed instance back
+ final Country managedCountry = this.createManaged(headquarter.getHeadquarterCountry());
+
+ // Set it back in branch office
+ headquarter.setHeadquarterCountry(managedCountry);
+ }
+
+ // Set "created" timestamp on any number assigned
+ this.setAllPhoneEntriesCreated(headquarter);
+
+ // Get opening times
+ final List<OpeningTime> openingTimes = headquarter.getHeadquarterOpeningTimes();
+
+ // Debugging:
+ this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarter(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
+
+ // Is opening times set and not empty?
+ if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
+ // Add created timestamp for all times
+ this.setAllOpeningTimesCreated(openingTimes);
+ } else {
+ // Set all to null
+ headquarter.setHeadquarterOpeningTimes(null);
+ }
+
+ // Persist it
+ this.getEntityManager().persist(headquarter);
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquarterId())); //NOI18N
+
+ // Return updated instance
+ return headquarter;
+ }
+
+ /**
+ * Checks if given branch office's address is already persisted. The whole
+ * (persisted) list is being loaded and each address is being matched
+ * against the given branch office's address.
+ * <p>
+ * @param headquarter Headquarter office being checked
+ * <p>
+ * @return Whether it has been found
+ */
+ private boolean isHeadquarterFound (final Headquarter headquarter) {
+ // Get whole list
+ final List<Headquarter> headquarters = this.headquarterBean.allHeadquarters();
+
+ // Default is not found
+ boolean isFound = false;
+
+ // Check all single addresses
+ for (final Headquarter hq : headquarters) {
+ // Is the same address found?
+ if (Headquarters.isSameAddress(hq, headquarter)) {
+ // Found one
+ isFound = true;
+ break;
+ }
+ }
+
+ // Return flag
+ return isFound;
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2017, 2018 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * 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.jcontactsbusiness.model.headquarter;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.List;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A stateless session bean for administrative branch office purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "adminHeadquarter", description = "An administrative statless bean for handling branch office data (all)")
-public class AddressbookAdminHeadquarterSessionBean extends BaseAddressbookEnterpriseBean implements AdminHeadquarterSessionBeanRemote {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 58_467_386_571_701L;
-
- /**
- * General branch office bean
- */
- @EJB (lookup = "java:global/addressbook-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
- private HeadquarterSessionBeanRemote headquarterBean;
-
- /**
- * Default constructor
- */
- public AddressbookAdminHeadquarterSessionBean () {
- // Call super constructor
- super();
- }
-
- @Override
- public Headquarter addHeadquarter (final Headquarter headquarter) throws HeadquarterAlreadyAddedException {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
-
- // Validate parameter
- if (null == headquarter) {
- // Throw NPE
- throw new NullPointerException("headquarter is null"); //NOI18N
- } else if (headquarter.getHeadquarterId() instanceof Long) {
- // Should not happen
- throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
- } else if (this.isHeadquarterFound(headquarter)) {
- // Already added, abort here
- throw new HeadquarterAlreadyAddedException(headquarter);
- }
-
- // Add created timestamp
- headquarter.setHeadquarterCreated(new Date());
-
- // Is user instance set?
- if (headquarter.getHeadquarterUserOwner() instanceof User) {
- // Get managed instance back
- final User managedUser = this.createManaged(headquarter.getHeadquarterUserOwner());
-
- // Set it back in branch office
- headquarter.setHeadquarterUserOwner(managedUser);
- }
-
- // Is user instance set?
- if (headquarter.getHeadquarterCountry() instanceof Country) {
- // Get managed instance back
- final Country managedCountry = this.createManaged(headquarter.getHeadquarterCountry());
-
- // Set it back in branch office
- headquarter.setHeadquarterCountry(managedCountry);
- }
-
- // Set "created" timestamp on any number assigned
- this.setAllPhoneEntriesCreated(headquarter);
-
- // Get opening times
- final List<OpeningTime> openingTimes = headquarter.getHeadquarterOpeningTimes();
-
- // Debugging:
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarter(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
-
- // Is opening times set and not empty?
- if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
- // Add created timestamp for all times
- this.setAllOpeningTimesCreated(openingTimes);
- } else {
- // Set all to null
- headquarter.setHeadquarterOpeningTimes(null);
- }
-
- // Persist it
- this.getEntityManager().persist(headquarter);
-
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquarterId())); //NOI18N
-
- // Return updated instance
- return headquarter;
- }
-
- /**
- * Checks if given branch office's address is already persisted. The whole
- * (persisted) list is being loaded and each address is being matched
- * against the given branch office's address.
- * <p>
- * @param headquarter Headquarter office being checked
- * <p>
- * @return Whether it has been found
- */
- private boolean isHeadquarterFound (final Headquarter headquarter) {
- // Get whole list
- final List<Headquarter> headquarters = this.headquarterBean.allHeadquarters();
-
- // Default is not found
- boolean isFound = false;
-
- // Check all single addresses
- for (final Headquarter hq : headquarters) {
- // Is the same address found?
- if (Headquarters.isSameAddress(hq, headquarter)) {
- // Found one
- isFound = true;
- break;
- }
- }
-
- // Return flag
- return isFound;
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * 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.jcontactsbusiness.model.headquarter;
+
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
+import org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote;
+
+/**
+ * A stateless session bean for general headquarter purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "headquarter", description = "A general statless bean for handling headquarter data (all)")
+public class AddressbookHeadquarterSessionBean extends BaseAddressbookEnterpriseBean implements HeadquarterSessionBeanRemote {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 58_467_386_571_701L;
+
+ @Override
+ @SuppressWarnings ("unchecked")
+ public List<Headquarter> allHeadquarters () {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+ // Get query
+ final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
+
+ // Get list from it
+ final List<Headquarter> list = query.getResultList();
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+ // Return it
+ return list;
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2017, 2018 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * 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.jcontactsbusiness.model.headquarter;
-
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.persistence.Query;
-import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
-import org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote;
-
-/**
- * A stateless session bean for general headquarter purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "headquarter", description = "A general statless bean for handling headquarter data (all)")
-public class AddressbookHeadquarterSessionBean extends BaseAddressbookEnterpriseBean implements HeadquarterSessionBeanRemote {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 58_467_386_571_701L;
-
- @Override
- @SuppressWarnings ("unchecked")
- public List<Headquarter> allHeadquarters () {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
- // Get query
- final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
-
- // Get list from it
- final List<Headquarter> list = query.getResultList();
-
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
- // Return it
- return list;
- }
-
-}
import java.util.Date;
import javax.ejb.EJB;
import javax.ejb.Stateless;
-import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
/**
* An administrative user EJB
*/
private static final long serialVersionUID = 542_145_347_916L;
- /**
- * Registration EJB
- */
- @EJB
- private UserRegistrationSessionBeanRemote registerBean;
-
/**
* Regular user bean
*/
- @EJB
+ @EJB (lookup = "java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
private UserSessionBeanRemote userBean;
/**
if (null == user) {
// Abort here
throw new NullPointerException("user is null"); //NOI18N
- } else if (user.getUserId() instanceof Long) {
+ } else if (user.getUserId() != null) {
// Not allowed here
throw new IllegalStateException(MessageFormat.format("user.userId must be null, is: {0}", user.getUserId())); //NOI18N
}
// Check if user is registered
- if (this.registerBean.isUserNameRegistered(user)) {
+ if (this.userBean.isUserNameRegistered(user)) {
// Abort here
throw new UserNameAlreadyRegisteredException(user);
- } else if (this.registerBean.isEmailAddressRegistered(user)) {
+ } else if (this.userBean.isEmailAddressRegistered(user)) {
// Abort here
throw new EmailAddressAlreadyRegisteredException(user);
}
import org.mxchange.juserlogincore.container.login.LoginContainer;
import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
/**
* A session EJB for user logins
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-@Stateless (name = "userLogin", description = "A bean handling the user login for Addressbook project")
+@Stateless (name = "userLogin", description = "A bean handling the application-specific user login")
public class AddressbookUserLoginSessionBean extends BaseAddressbookEnterpriseBean implements UserLoginSessionBeanRemote {
/**
*/
private static final long serialVersionUID = 21_785_978_127_581_965L;
- /**
- * Registration EJB
- */
- @EJB
- private UserRegistrationSessionBeanRemote registerBean;
-
/**
* User EJB
*/
- @EJB
+ @EJB (lookup = "java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
private UserSessionBeanRemote userBean;
/**
// Trace message
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
- assert (this.registerBean instanceof UserRegistrationSessionBeanRemote) : "this.registerBean is not set"; //NOI18N
-
// user should not be null
if (null == container) {
// Abort here
}
// Is the account there?
- if (!this.registerBean.isUserNameRegistered(container.getUser())) {
+ if (!this.userBean.isUserNameRegistered(container.getUser())) {
// Not registered
throw new UserNotFoundException(container.getUser());
}
/**
* Administrative user bean
*/
- @EJB
+ @EJB (lookup = "java:global/addressbook-ejb/adminUser!org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote")
private AdminUserSessionBeanRemote adminUserBean;
/**
* Regular user EJB
*/
- @EJB
+ @EJB (lookup = "java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
private UserSessionBeanRemote userBean;
/**
return confirmationKey;
}
- @Override
- public boolean isEmailAddressRegistered (final User user) {
- // Trace message
- 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
-
- // user should not be null
- if (null == user) {
- // Abort here
- throw new NullPointerException("user is null"); //NOI18N
- }
-
- // Call other bean
- return this.userBean.isEmailAddressRegistered(user);
- }
-
- @Override
- public boolean isUserNameRegistered (final User user) {
- // Trace message
- 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
-
- // user should not be null
- if (null == user) {
- // Abort here
- throw new NullPointerException("user is null"); //NOI18N
- }
-
- // Call other bean
- return this.userBean.isUserNameRegistered(user);
- }
-
@Override
public User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
// Trace message
}
// Check if user is registered
- if (this.isUserNameRegistered(user)) {
+ if (this.userBean.isUserNameRegistered(user)) {
// Abort here
throw new UserNameAlreadyRegisteredException(user);
- } else if (this.isEmailAddressRegistered(user)) {
+ } else if (this.userBean.isEmailAddressRegistered(user)) {
// Abort here
throw new EmailAddressAlreadyRegisteredException(user);
}