From: Roland Häder Date: Sat, 1 Jul 2017 10:12:15 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f10d234f2f8857a0e93d9be5ad75a58c2326cf10;p=addressbook-war.git Please cherry-pick: - don't have observer methods in interfaces around as interfaces on web beans (aka. controllers) are for direct method calls, not for CDI events - added missing @Observes annotation Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java index 95484045..f60d8bc5 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/AddressbookContactWebSessionBean.java @@ -275,7 +275,7 @@ public class AddressbookContactWebSessionBean extends BaseAddressbookController } /** - * Event observer for newly added users by adminstrator + * Event observer for newly added users by administrator *

* @param event Event being fired */ diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java index 73daf1ee..b005fcfa 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationBean.java @@ -94,7 +94,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.landLineNumbers = new LinkedList<>(); } - @Override + /** + * Observes events being fired when an administrator has added a new + * contact. + *

+ * @param event Event being fired + */ public void afterAdminAddedContactEvent (@Observes final ObservableAdminAddedContactEvent event) { // The event must be valid if (null == event) { @@ -118,7 +123,11 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Event observer for newly added users by administrator + *

+ * @param event Event being fired + */ public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) { // event should not be null if (null == event) { @@ -142,7 +151,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a fax + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedFaxNumberEvent (@Observes final AdminDeletedFaxNumberEvent event) { // event should not be null if (null == event) { @@ -166,7 +180,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a land-line + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedLandLineNumberEvent (@Observes final AdminDeletedLandLineNumberEvent event) { // event should not be null if (null == event) { @@ -190,7 +209,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has deleted a mobile + * number + *

+ * @param event Event being fired + */ public void afterAdminDeletedMobileNumberEvent (@Observes final AdminDeletedMobileNumberEvent event) { // event should not be null if (null == event) { @@ -214,7 +238,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has a linked a fax + * number + *

+ * @param event Event being fired + */ public void afterAdminLinkedFaxNumberEvent (@Observes final ObservableAdminLinkedFaxNumberEvent event) { // Is the event fine? if (event == null) { @@ -250,7 +279,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle } } - @Override + /** + * Observes events being fired when an administrator has a linked a + * land-line number + *

+ * @param event Event being fired + */ public void afterAdminLinkedLandLineNumberEvent (@Observes final ObservableAdminLinkedLandLineNumberEvent event) { // Is the event fine? if (event == null) { @@ -286,7 +320,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle } } - @Override + /** + * Observes events being fired when an administrator has a linked a mobile + * number + *

+ * @param event Event being fired + */ public void afterAdminLinkedMobileNumberEvent (@Observes final ObservableAdminLinkedMobileNumberEvent event) { // Is the event fine? if (event == null) { @@ -322,7 +361,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle } } - @Override + /** + * Observes events being fired when an administrator has updated contact + * data. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedContactDataEvent (@Observes final ObservableAdminUpdatedContactEvent event) { // event should not be null if (null == event) { @@ -346,7 +390,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a fax + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedFaxNumberEvent (@Observes final AdminUpdatedFaxNumberEvent event) { // event should not be null if (null == event) { @@ -370,7 +419,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a land-line + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedLandLineNumberEvent (@Observes final AdminUpdatedLandLineNumberEvent event) { // event should not be null if (null == event) { @@ -394,7 +448,12 @@ public class AddressbookPhoneWebApplicationBean extends BaseAddressbookControlle this.clear(); } - @Override + /** + * Observes events being fired when an administrator has updated a mobile + * number. + *

+ * @param event Event being fired + */ public void afterAdminUpdatedMobileNumberEvent (@Observes final AdminUpdatedMobileNumberEvent event) { // event should not be null if (null == event) { diff --git a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java index 6e2c78ec..0c8f9e4d 100644 --- a/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java +++ b/src/java/org/mxchange/addressbook/beans/phone/AddressbookPhoneWebApplicationController.java @@ -19,21 +19,9 @@ package org.mxchange.addressbook.beans.phone; import java.io.Serializable; import java.util.List; import javax.ejb.Local; -import org.mxchange.jphone.events.fax.deleted.AdminDeletedFaxNumberEvent; -import org.mxchange.jphone.events.fax.updated.AdminUpdatedFaxNumberEvent; -import org.mxchange.jphone.events.landline.deleted.AdminDeletedLandLineNumberEvent; -import org.mxchange.jphone.events.landline.updated.AdminUpdatedLandLineNumberEvent; -import org.mxchange.jphone.events.mobile.deleted.AdminDeletedMobileNumberEvent; -import org.mxchange.jphone.events.mobile.updated.AdminUpdatedMobileNumberEvent; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; -import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent; -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; /** * An interface for a request web controller (bean) for administrative phone @@ -44,100 +32,6 @@ import org.mxchange.jcontacts.events.mobile.linked.ObservableAdminLinkedMobileNu @Local public interface AddressbookPhoneWebApplicationController extends Serializable { - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContactEvent (final ObservableAdminAddedContactEvent event); - - /** - * Observes events being fired when an administrator has deleted a fax - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedFaxNumberEvent (final AdminDeletedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has deleted a land-line - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedLandLineNumberEvent (final AdminDeletedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has deleted a mobile - * number - *

- * @param event Event being fired - */ - void afterAdminDeletedMobileNumberEvent (final AdminDeletedMobileNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a fax - * number - *

- * @param event Event being fired - */ - void afterAdminLinkedFaxNumberEvent (final ObservableAdminLinkedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a - * land-line number - *

- * @param event Event being fired - */ - void afterAdminLinkedLandLineNumberEvent (final ObservableAdminLinkedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has a linked a mobile - * number - *

- * @param event Event being fired - */ - void afterAdminLinkedMobileNumberEvent (final ObservableAdminLinkedMobileNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a fax - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedFaxNumberEvent (final AdminUpdatedFaxNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a land-line - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedLandLineNumberEvent (final AdminUpdatedLandLineNumberEvent event); - - /** - * Observes events being fired when an administrator has updated a mobile - * number. - *

- * @param event Event being fired - */ - void afterAdminUpdatedMobileNumberEvent (final AdminUpdatedMobileNumberEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final ObservableAdminUpdatedContactEvent event); - /** * Returns a list of all mobile numbers. For performance reasons, the * controller (bean) should be application-scoped as from user to user diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java index 7607f65d..49d2e247 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookUserWebSessionBean.java @@ -196,7 +196,7 @@ public class AddressbookUserWebSessionBean extends BaseAddressbookController imp *

* @param event Event being fired */ - public void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event) { + public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) { // event should not be null if (null == event) { // Throw NPE