+ public void afterAdminDeletedFaxNumberEvent (@Observes final AdminDeletedFaxNumberEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getDeletedFaxNumber()== null) {
+ // Throw NPE again
+ throw new NullPointerException("event.deletedFaxNumber is null"); //NOI18N
+ } else if (event.getDeletedFaxNumber().getPhoneId() == null) {
+ // userId is null
+ throw new NullPointerException("event.deletedFaxNumber.phoneId is null"); //NOI18N
+ } else if (event.getDeletedFaxNumber().getPhoneId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("phoneId of contact={0} is not valid: {1}", event.getDeletedFaxNumber(), event.getDeletedFaxNumber().getPhoneId())); //NOI18N
+ }
+
+ // Update contact's mobile, land-line and fax number
+ this.allFaxNumbers().remove(event.getDeletedFaxNumber());
+
+ // Clear all data
+ this.clear();
+ }
+
+ @Override
+ public void afterAdminDeletedLandLineNumberEvent (@Observes final AdminDeletedLandLineNumberEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getDeletedLandLineNumber()== null) {
+ // Throw NPE again
+ throw new NullPointerException("event.deletedLandLineNumber is null"); //NOI18N
+ } else if (event.getDeletedLandLineNumber().getPhoneId() == null) {
+ // userId is null
+ throw new NullPointerException("event.deletedLandLineNumber.phoneId is null"); //NOI18N
+ } else if (event.getDeletedLandLineNumber().getPhoneId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("phoneId of contact={0} is not valid: {1}", event.getDeletedLandLineNumber(), event.getDeletedLandLineNumber().getPhoneId())); //NOI18N
+ }
+
+ // Update contact's mobile, land-line and fax number
+ this.allLandLineNumbers().remove(event.getDeletedLandLineNumber());
+
+ // Clear all data
+ this.clear();
+ }
+
+ @Override
+ public void afterAdminDeletedMobileNumberEvent (@Observes final AdminDeletedMobileNumberEvent event) {
+ // event should not be null
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getDeletedMobileNumber()== null) {
+ // Throw NPE again
+ throw new NullPointerException("event.deletedMobileNumber is null"); //NOI18N
+ } else if (event.getDeletedMobileNumber().getPhoneId() == null) {
+ // userId is null
+ throw new NullPointerException("event.deletedMobileNumber.phoneId is null"); //NOI18N
+ } else if (event.getDeletedMobileNumber().getPhoneId() < 1) {
+ // Not avalid id
+ throw new IllegalArgumentException(MessageFormat.format("phoneId of contact={0} is not valid: {1}", event.getDeletedMobileNumber(), event.getDeletedMobileNumber().getPhoneId())); //NOI18N
+ }
+
+ // Update contact's mobile, land-line and fax number
+ this.allMobileNumbers().remove(event.getDeletedMobileNumber());
+
+ // Clear all data
+ this.clear();
+ }
+
+ @Override
+ public void afterAdminLinkedFaxNumberEvent (@Observes final ObservableAdminLinkedFaxNumberEvent event) {
+ // Is the event fine?
+ if (event == null) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getContact() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact is null");
+ } else if (event.getContact().getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId is null");
+ } else if (event.getContact().getContactId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid");
+ } else if (event.getContact().getContactFaxNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactFaxNumber is null");
+ } else if (event.getContact().getContactFaxNumber().getPhoneId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactFaxNumber.phoneId is null");
+ } else if (event.getContact().getContactFaxNumber().getPhoneId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactFaxNumber.phoneId="+event.getContact().getContactFaxNumber().getPhoneId() + " is invalid");
+ } else if (event.getLinkedFaxNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.linkedFaxNumer is null");
+ }
+
+ // Is the id number in linked number not set?
+ if (event.getLinkedFaxNumber().getPhoneId() == null) {
+ // Then it is a new number, so add it from contact as there the id number has been set
+ this.uniqueAddFaxNumber(event.getContact().getContactFaxNumber());
+ }
+ }
+
+ @Override
+ public void afterAdminLinkedLandLineNumberEvent (@Observes final ObservableAdminLinkedLandLineNumberEvent event) {
+ // Is the event fine?
+ if (event == null) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getContact() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact is null");
+ } else if (event.getContact().getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId is null");
+ } else if (event.getContact().getContactId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid");
+ } else if (event.getContact().getContactLandLineNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactLandLineNumber is null");
+ } else if (event.getContact().getContactLandLineNumber().getPhoneId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactLandLineNumber.phoneId is null");
+ } else if (event.getContact().getContactLandLineNumber().getPhoneId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactLandLineNumber.phoneId="+event.getContact().getContactLandLineNumber().getPhoneId() + " is invalid");
+ } else if (event.getLinkedLandLineNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.linkedLandLineNumer is null");
+ }
+
+ // Is the id number in linked number not set?
+ if (event.getLinkedLandLineNumber().getPhoneId() == null) {
+ // Then it is a new number, so add it from contact as there the id number has been set
+ this.uniqueAddLandLineNumber(event.getContact().getContactLandLineNumber());
+ }
+ }
+
+ @Override
+ public void afterAdminLinkedMobileNumberEvent (@Observes final ObservableAdminLinkedMobileNumberEvent event) {
+ // Is the event fine?
+ if (event == null) {
+ // Throw NPE
+ throw new NullPointerException("event is null"); //NOI18N
+ } else if (event.getContact() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact is null");
+ } else if (event.getContact().getContactId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId is null");
+ } else if (event.getContact().getContactId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactId="+ event.getContact().getContactId() + " is invalid");
+ } else if (event.getContact().getContactMobileNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactMobileNumber is null");
+ } else if (event.getContact().getContactMobileNumber().getPhoneId() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactMobileNumber.phoneId is null");
+ } else if (event.getContact().getContactMobileNumber().getPhoneId() < 1) {
+ // Throw again ...
+ throw new NullPointerException("event.contact.contactMobileNumber.phoneId="+event.getContact().getContactMobileNumber().getPhoneId() + " is invalid");
+ } else if (event.getLinkedMobileNumber() == null) {
+ // Throw again ...
+ throw new NullPointerException("event.linkedMobileNumer is null");
+ }
+
+ // Is the id number in linked number not set?
+ if (event.getLinkedMobileNumber().getPhoneId() == null) {
+ // Then it is a new number, so add it from contact as there the id number has been set
+ this.uniqueAddMobileNumber(event.getContact().getContactMobileNumber());
+ }
+ }
+
+ @Override
+ public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) {