}
@Override
- public String deleteMobileData () {
+ public String deleteMobileData (final DialableMobileNumber mobileNumber) {
+ // Log message
+ System.out.println(MessageFormat.format("{0}.deleteMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber)); //NOI18N
+
// Is all data set
- if (this.beanHelper.getMobileNumber() == null) {
+ if (mobileNumber == null) {
// Not set, throw NPE
- throw new NullPointerException("this.beanHelper.mobileNumber is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneId() == null) {
+ throw new NullPointerException("mobileNumber is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() == null) {
// Throw NPE again
- throw new NullPointerException("this.beanHelper.mobileNumber.phoneId is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneId() < 1) {
+ throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() < 1) {
// Invalid number
- throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.mobileNumber.phoneId={0} is not valid", this.beanHelper.getMobileNumber().getPhoneId())); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
+ } else if (mobileNumber.getMobileProvider() == null) {
// Throw NPE
- throw new NullPointerException("this.beanHelper.mobileNumber.mobileProvider is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider().getProviderId() == null) {
+ throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
+ } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
// ... throw again
- throw new NullPointerException("this.beanHelper.mobileNumber.mobileProvider.providerId is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider().getProviderId() < 1) {
+ throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
+ } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
// Id not valid
- throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.mobileNumber.mobileProvider.providerId={0} is not valid.", this.beanHelper.getMobileNumber().getMobileProvider().getProviderId())); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneNumber() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
+ } else if (mobileNumber.getPhoneNumber() == null) {
// Throw NPE again
- throw new NullPointerException("this.beanHelper.mobileNumber.phoneNumber is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneNumber() < 1) {
+ throw new NullPointerException("mobileNumber.phoneNumber is null"); //NOI18N
+ } else if (mobileNumber.getPhoneNumber() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("this.beanHelper.mobileNumber.phoneNumber={0} is not valid.", this.beanHelper.getMobileNumber().getPhoneNumber())); //NOI18N
+ throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", mobileNumber.getPhoneNumber())); //NOI18N
}
// Call EJB
- this.adminPhoneBean.deleteMobileData(this.beanHelper.getMobileNumber());
+ this.adminPhoneBean.deleteMobileData(mobileNumber);
// Fire event
- this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(this.beanHelper.getMobileNumber()));
+ this.mobileNumberDeletedEvent.fire(new AdminMobileNumberDeletedEvent(mobileNumber));
// All fine, redirect
return "admin_list_mobile"; //NOI18N
}
@Override
- public String editMobileData () {
+ public String editMobileData (final DialableMobileNumber mobileNumber) {
// Log message
- System.out.println(MessageFormat.format("{0}.editMobileData: CALLED!", this.getClass().getSimpleName())); //NOI18N
+ System.out.println(MessageFormat.format("{0}.editMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber)); //NOI18N
// Is all data set
- if (this.beanHelper.getMobileNumber() == null) {
+ if (mobileNumber == null) {
// Not set, throw NPE
- throw new NullPointerException("this.beanHelper.mobileNumber is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneId() == null) {
+ throw new NullPointerException("mobileNumber is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() == null) {
// Throw NPE again
- throw new NullPointerException("this.beanHelper.mobileNumber.phoneId is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneId() < 1) {
+ throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
+ } else if (mobileNumber.getPhoneId() < 1) {
// Invalid number
- throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.mobileNumber.phoneId={0} is not valid", this.beanHelper.getMobileNumber().getPhoneId())); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getPhoneId())); //NOI18N
+ } else if (mobileNumber.getMobileProvider() == null) {
// Throw NPE
- throw new NullPointerException("this.beanHelper.mobileNumber.mobileProvider is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider().getProviderId() == null) {
+ throw new NullPointerException("mobileNumber.mobileProvider is null"); //NOI18N
+ } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
// ... throw again
- throw new NullPointerException("this.beanHelper.mobileNumber.mobileProvider.providerId is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getMobileProvider().getProviderId() < 1) {
+ throw new NullPointerException("mobileNumber.mobileProvider.providerId is null"); //NOI18N
+ } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
// Id not valid
- throw new IllegalArgumentException(MessageFormat.format("this.beanHelper.mobileNumber.mobileProvider.providerId={0} is not valid.", this.beanHelper.getMobileNumber().getMobileProvider().getProviderId())); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneNumber() == null) {
+ throw new IllegalArgumentException(MessageFormat.format("mobileNumber.mobileProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
+ } else if (mobileNumber.getPhoneNumber() == null) {
// Throw NPE again
- throw new NullPointerException("this.beanHelper.mobileNumber.phoneNumber is null"); //NOI18N
- } else if (this.beanHelper.getMobileNumber().getPhoneNumber() < 1) {
+ throw new NullPointerException("mobileNumber.phoneNumber is null"); //NOI18N
+ } else if (mobileNumber.getPhoneNumber() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("this.beanHelper.mobileNumber.phoneNumber={0} is not valid.", this.beanHelper.getMobileNumber().getPhoneNumber())); //NOI18N
+ throw new NullPointerException(MessageFormat.format("mobileNumber.phoneNumber={0} is not valid.", mobileNumber.getPhoneNumber())); //NOI18N
} else if (this.getMobileProvider() == null) {
// Not provided
this.showFacesMessage("form_edit_mobile:mobileProvider", "ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED"); //NOI18N
}
// Log message
- System.out.println(MessageFormat.format("{0}.editMobileData: this.mobileProvider.providerId={1},this.beanHelper.mobileNumber.mobileProvider.providerId={2},this.phoneNumber={3},this.beanHelper.mobileNumber.phoneNumber={4}", this.getClass().getSimpleName(), this.getMobileProvider().getProviderId(), this.beanHelper.getMobileNumber().getMobileProvider().getProviderId(), this.getPhoneNumber(), this.beanHelper.getMobileNumber().getPhoneNumber())); //NOI18N
+ System.out.println(MessageFormat.format("{0}.editMobileData: this.mobileProvider.providerId={1},mobileNumber.mobileProvider.providerId={2},this.phoneNumber={3},mobileNumber.phoneNumber={4}", this.getClass().getSimpleName(), this.getMobileProvider().getProviderId(), mobileNumber.getMobileProvider().getProviderId(), this.getPhoneNumber(), mobileNumber.getPhoneNumber())); //NOI18N
// Is the mobile provider and number the same?
- if ((Objects.equals(this.getMobileProvider(), this.beanHelper.getMobileNumber().getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), this.beanHelper.getMobileNumber().getPhoneNumber()))) {
+ if ((Objects.equals(this.getMobileProvider(), mobileNumber.getMobileProvider())) && (Objects.equals(this.getPhoneNumber(), mobileNumber.getPhoneNumber()))) {
// Log message
System.out.println(MessageFormat.format("{0}.editMobileData: No difference - EXIT!", this.getClass().getSimpleName())); //NOI18N
}
// Set all data
- this.beanHelper.getMobileNumber().setMobileProvider(this.getMobileProvider());
- this.beanHelper.getMobileNumber().setPhoneNumber(this.getPhoneNumber());
+ mobileNumber.setMobileProvider(this.getMobileProvider());
+ mobileNumber.setPhoneNumber(this.getPhoneNumber());
// Send to bean
- DialableMobileNumber updatedNumber = this.adminPhoneBean.updateMobileData(this.beanHelper.getMobileNumber());
+ DialableMobileNumber updatedNumber = this.adminPhoneBean.updateMobileData(mobileNumber);
// Fire event
this.mobileNumberUpdatedEvent.fire(new AdminMobileNumberUpdatedEvent(updatedNumber));