import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontacts.model.contact.Contacts;
+import org.mxchange.jcontacts.model.utils.ContactUtils;
import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.department.Departments;
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.opening_time.OpeningTime;
+import org.mxchange.jcontactsbusiness.model.utils.BranchOfficeUtils;
+import org.mxchange.jcontactsbusiness.model.utils.DepartmentUtils;
import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.utils.FaxNumberUtils;
+import org.mxchange.jphone.model.utils.LandLineNumberUtils;
+import org.mxchange.jphone.model.utils.MobileNumberUtils;
import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.Users;
+import org.mxchange.jusercore.model.utils.UserUtils;
/**
* A helper class for beans that access the database.
this.getLoggerBeanLocal().logDebug(MessageFormat.format("mergeBranchOfficeData: foundContact.contactId={0}", foundBranchOffice.getBranchId())); //NOI18N
// Copy all
- BranchOffices.copyBranchOfficeData(detachedBranchOffice, foundBranchOffice);
+ BranchOfficeUtils.copyBranchOfficeData(detachedBranchOffice, foundBranchOffice);
// Merge contact instance
final BranchOffice managedBranchOffice = this.getEntityManager().merge(foundBranchOffice);
this.getLoggerBeanLocal().logDebug(MessageFormat.format("mergeContactData: foundContact.contactId={0}", foundContact.getContactId())); //NOI18N
// Copy all
- Contacts.copyContactData(detachedContact, foundContact);
+ ContactUtils.copyContactData(detachedContact, foundContact);
// Merge contact instance
final Contact managedContact = this.getEntityManager().merge(foundContact);
assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getMobileId()); //NOI18N
// Copy all
- MobileNumbers.copyMobileNumberData(detachedContact.getContactMobileNumber(), foundMobile);
+ MobileNumberUtils.copyMobileNumberData(detachedContact.getContactMobileNumber(), foundMobile);
// Then merge it, too
final DialableMobileNumber managedMobile = this.getEntityManager().merge(foundMobile);
assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
// Copy all
- FaxNumbers.copyFaxNumberData(detachedContact.getContactFaxNumber(), foundFax);
+ FaxNumberUtils.copyFaxNumberData(detachedContact.getContactFaxNumber(), foundFax);
// Then merge it, too
final DialableFaxNumber managedFax = this.getEntityManager().merge(foundFax);
assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
// Copy all
- LandLineNumbers.copyLandLineNumberData(detachedContact.getContactLandLineNumber(), foundLandLine);
+ LandLineNumberUtils.copyLandLineNumberData(detachedContact.getContactLandLineNumber(), foundLandLine);
// Then merge it, too
final DialableLandLineNumber managedLandLine = this.getEntityManager().merge(foundLandLine);
this.getLoggerBeanLocal().logDebug(MessageFormat.format("mergeDepartmentData: foundContact.contactId={0}", foundDepartment.getDepartmentId())); //NOI18N
// Copy all
- Departments.copyDepartmentData(detachedDepartment, foundDepartment);
+ DepartmentUtils.copyDepartmentData(detachedDepartment, foundDepartment);
// Merge contact instance
final Department managedDepartment = this.getEntityManager().merge(foundDepartment);
DialableFaxNumber detachedNumber = null;
// Is there a difference?
- if (!FaxNumbers.isSameFaxNumber(faxNumber, fetchedNumber)) {
+ if (!FaxNumberUtils.isSameFaxNumber(faxNumber, fetchedNumber)) {
// @TODO Copy all to foundNumber, then merge
// Merge this entry
DialableLandLineNumber detachedNumber = null;
// Is there a difference?
- if (!LandLineNumbers.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
+ if (!LandLineNumberUtils.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
// @TODO Copy all to foundNumber, then merge
// Merge this entry
DialableMobileNumber detachedNumber = null;
// Is there a difference?
- if (!MobileNumbers.isSameMobileNumber(mobileNumber, fetchedNumber)) {
+ if (!MobileNumberUtils.isSameMobileNumber(mobileNumber, fetchedNumber)) {
// @TODO Copy all to foundNumber, then merge
// Merge this entry
}
// Set all values
- final Properties variables = Users.getAllUserFields(user);
+ final Properties variables = UserUtils.getAllUserFields(user);
// Set base URL and random password
variables.put("baseUrl", baseUrl); //NOI18N
this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactMobileNumber={0}", other.getContactMobileNumber())); //NOI18N
// Is other mobile not set?
- if ((other.getContactMobileNumber() == null) || (MobileNumbers.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
+ if ((other.getContactMobileNumber() == null) || (MobileNumberUtils.isSameMobileNumber(contact.getContactMobileNumber(), other.getContactMobileNumber()))) {
// Debug message
this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying mobile entry ..."); //NOI18N
this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactLandLineNumber={0}", other.getContactLandLineNumber())); //NOI18N
// Is other mobile not set?
- if ((other.getContactLandLineNumber() == null) || (LandLineNumbers.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
+ if ((other.getContactLandLineNumber() == null) || (LandLineNumberUtils.isSameLandLineNumber(contact.getContactLandLineNumber(), other.getContactLandLineNumber()))) {
// Debug message
this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying land-line entry ..."); //NOI18N
this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllContactPhoneEntries: other.contactFaxNumber={0}", other.getContactFaxNumber())); //NOI18N
// Is other mobile not set?
- if ((other.getContactFaxNumber() == null) || (FaxNumbers.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
+ if ((other.getContactFaxNumber() == null) || (FaxNumberUtils.isSameFaxNumber(contact.getContactFaxNumber(), other.getContactFaxNumber()))) {
// Debug message
this.getLoggerBeanLocal().logDebug("setAllContactPhoneEntries: Copying fax entry ..."); //NOI18N
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
-import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
-import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
+import org.mxchange.jphone.model.utils.FaxNumberUtils;
+import org.mxchange.jphone.model.utils.LandLineNumberUtils;
+import org.mxchange.jphone.model.utils.MobileNumberUtils;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
import org.mxchange.jusercore.model.user.password_history.UserPasswordHistory;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.jusercore.model.utils.UserUtils;
/**
* A user EJB
assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N
// Copy all data
- Users.copyUserData(user, foundUser);
+ UserUtils.copyUserData(detachedUser, foundUser);
// Merge user
final User managedUser = this.getEntityManager().merge(foundUser);
assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N
// Copy all data
- Users.copyUserData(user, managedUser);
+ UserUtils.copyUserData(user, managedUser);
// Set as updated
managedUser.setUserEntryUpdated(new Date());
assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getMobileId()); //NOI18N
// Copy all
- MobileNumbers.copyMobileNumberData(managedUser.getUserContact().getContactMobileNumber(), foundMobile);
+ MobileNumberUtils.copyMobileNumberData(managedUser.getUserContact().getContactMobileNumber(), foundMobile);
// Then merge it, too
final DialableMobileNumber managedMobile = this.getEntityManager().merge(foundMobile);
assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); //NOI18N
// Copy all
- FaxNumbers.copyFaxNumberData(managedUser.getUserContact().getContactFaxNumber(), foundFax);
+ FaxNumberUtils.copyFaxNumberData(managedUser.getUserContact().getContactFaxNumber(), foundFax);
// Then merge it, too
final DialableFaxNumber managedFax = this.getEntityManager().merge(foundFax);
assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); //NOI18N
// Copy all
- LandLineNumbers.copyLandLineNumberData(managedUser.getUserContact().getContactLandLineNumber(), foundLandLine);
+ LandLineNumberUtils.copyLandLineNumberData(managedUser.getUserContact().getContactLandLineNumber(), foundLandLine);
// Then merge it, too
final DialableLandLineNumber managedLandLine = this.getEntityManager().merge(foundLandLine);