From 1df27420954d62e132827a1b5811ecb5a6de9357 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 19 May 2016 17:56:30 +0200 Subject: [PATCH] An event is now fired after confirmation of the account has completed. This can be observed to update "cached" lists MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../JobsConfirmationLinkWebRequestBean.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java index 0f075181..1e967993 100644 --- a/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/confirmlink/JobsConfirmationLinkWebRequestBean.java @@ -21,6 +21,8 @@ import java.util.Iterator; import java.util.List; import java.util.Objects; import javax.enterprise.context.RequestScoped; +import javax.enterprise.event.Event; +import javax.enterprise.inject.Any; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; import javax.inject.Named; @@ -31,6 +33,8 @@ import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.helper.JobsWebRequestController; import org.mxchange.jjobs.beans.user.JobsUserWebSessionController; +import org.mxchange.jusercore.events.confirmation.ConfirmedUserAccountEvent; +import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent; import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.model.user.User; @@ -67,6 +71,13 @@ public class JobsConfirmationLinkWebRequestBean extends BaseJobsController imple */ private final UserSessionBeanRemote userBean; + /** + * Event being fired when a user has confirmed the account + */ + @Inject + @Any + private Event userConfirmedEvent; + /** * User controller */ @@ -191,6 +202,9 @@ public class JobsConfirmationLinkWebRequestBean extends BaseJobsController imple throw new FaceletException(MessageFormat.format("Cannot confirm user account {0}", user.getUserName()), ex); //NOI18N } + // Fire event that the user has confirmed account + this.userConfirmedEvent.fire(new ConfirmedUserAccountEvent(updatedUser)); + // Set it again in helper this.beanHelper.setUser(updatedUser); } -- 2.39.5