import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote;
-import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.model.contact.ContactUtils;
-import org.mxchange.jcontacts.model.contact.UserContact;
-import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent;
import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
+import org.mxchange.jcontacts.model.contact.AdminContactSessionBeanRemote;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
+import org.mxchange.jcontacts.model.contact.ContactUtils;
+import org.mxchange.jcontacts.model.contact.UserContact;
+import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.model.phonenumbers.DialableNumber;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* An administrative user controller (bean)
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
+import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
import org.mxchange.jcontacts.model.contact.ContactUtils;
import org.mxchange.jcontacts.model.contact.UserContact;
import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
-import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
-import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
import org.mxchange.jusercore.model.user.User;
assert (this.isRequiredPersonalDataSet()) : "not all personal data is set"; //NOI18N
// Generate phone number
- DialableLandLineNumber phone = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
- DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
- DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
+ final DialableLandLineNumber landLine = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber());
+ final DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber());
+ final DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber());
// Create new contact
Contact contact = new UserContact(this.getPersonalTitle(), this.getFirstName(), this.getFamilyName());
contact.setContactComment(this.getComment());
// Don't set null or wrong references
- if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
+ if ((landLine instanceof DialableLandLineNumber) && (landLine.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) {
// Now the number must be given
- if (phone.getPhoneAreaCode() == null) {
+ if (landLine.getPhoneAreaCode() == null) {
// Is null
throw new NullPointerException("phone.phoneAreaCode is null"); //NOI18N
- } else if (phone.getPhoneAreaCode() < 1) {
+ } else if (landLine.getPhoneAreaCode() < 1) {
// Abort here
throw new IllegalArgumentException("phone.phoneAreaCode is zero or below."); //NOI18N
- } else if (phone.getPhoneNumber() == null) {
+ } else if (landLine.getPhoneNumber() == null) {
// Is null
throw new NullPointerException("phone.phoneNumber is null"); //NOI18N
- } else if (phone.getPhoneNumber() < 1) {
+ } else if (landLine.getPhoneNumber() < 1) {
// Abort here
throw new IllegalArgumentException("phone.phoneNumber is zero or below."); //NOI18N
}
// Set phone number
- contact.setContactLandLineNumber(phone);
+ contact.setContactLandLineNumber(landLine);
}
// Don't set null or wrong references
import javax.enterprise.inject.Any;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
import org.mxchange.jcontacts.events.mobile.unlinked.AdminUnlinkedMobileNumberEvent;
import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.phone.AdminContactsPhoneSessionBeanRemote;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
/**
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.events.fax.unlinked.ObservableAdminUnlinkedFaxNumberEvent;
import org.mxchange.jcontacts.events.landline.unlinked.ObservableAdminUnlinkedLandLineNumberEvent;
import org.mxchange.jcontacts.events.mobile.unlinked.ObservableAdminUnlinkedMobileNumberEvent;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
import org.mxchange.jphone.model.phonenumbers.DialableNumber;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
/**
import javax.enterprise.inject.Any;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.events.contact.created.CreatedContactEvent;
import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEvent;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
import org.mxchange.jphone.events.mobile.created.ObservableCreatedMobileNumberEvent;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jphone.exceptions.MobileProviderAlreadyAddedException;
import org.mxchange.jphone.model.phonenumbers.mobileprovider.AdminMobileProviderSessionBeanRemote;
import org.mxchange.jphone.model.phonenumbers.mobileprovider.CellphoneProvider;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* Administrative controller (bean) for mobile provider
*/
public String addMobileProvider () {
// Create mobile provider
- MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
+ final MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
// Is the provider already created?
if (this.isMobileProviderCreated(mobileProvider)) {
}
// Init variable
- MobileProvider updatedProvider = null;
+ final MobileProvider updatedProvider;
try {
// Call remote EJB and get back an updated instance
import javax.inject.Named;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.events.mobileprovider.added.AdminAddedMobileProviderEvent;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
/**
import java.io.Serializable;
import java.util.List;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
/**
* An interface for general mobile provider controller
import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
/**
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
-import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
import org.mxchange.jcontacts.events.fax.linked.ObservableAdminLinkedFaxNumberEvent;
import org.mxchange.jcontacts.events.landline.linked.ObservableAdminLinkedLandLineNumberEvent;
import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNumberEvent;
+import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent;
import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent;
import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
import java.util.List;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
/**
* An interface for a request web controller (bean) for administrative phone
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
-import org.mxchange.jphone.phonenumbers.model.mobile.DialableMobileNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.phone.PhoneSessionBeanRemote;
/**
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jphone.phonenumbers.model.mobileprovider.MobileProvider;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote;
/**