From 795af1efc2b3e5dc39432753329647dde7583fc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 25 Aug 2016 14:55:25 +0200 Subject: [PATCH] Continued a bit: - added event when user has resend confirmation link - tpzo fixed --- .../ConfirmedUserAccountEvent.java | 7 +- .../UserConfirmedAccountEvent.java | 2 +- .../registration/RegisteredUserEvent.java | 2 +- .../registration/UserRegisteredEvent.java | 2 +- .../ResendLinkUserAccountEvent.java | 66 +++++++++++++++++++ .../UserResendLinkAccountEvent.java | 36 ++++++++++ 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java create mode 100644 src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java diff --git a/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java b/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java index 0481159..0dcc07c 100644 --- a/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java +++ b/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java @@ -20,7 +20,7 @@ import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An event, fireed if a new confirmedUser has confirmed + * An event, fired if a new confirmedUser has confirmed *

* @author Roland Haeder */ @@ -58,11 +58,6 @@ public class ConfirmedUserAccountEvent implements UserConfirmedAccountEvent { this.confirmedUser = confirmedUser; } - /** - * Getter for confirmedUser instance - *

- * @return User instance - */ @Override public User getConfirmedUser () { return this.confirmedUser; diff --git a/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java b/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java index 1bbea50..c66bd6b 100644 --- a/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java +++ b/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jusercore.model.user.User; /** - * An event interface, fireed if a new user has registered + * An event interface, fired if a new user has registered *

* @author Roland Haeder */ diff --git a/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java b/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java index 85ae473..d825aaa 100644 --- a/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java +++ b/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java @@ -20,7 +20,7 @@ import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An event, fireed if a new registeredUser has registered + * An event, fired if a new registeredUser has registered *

* @author Roland Haeder */ diff --git a/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java b/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java index ee1ecbe..f47856f 100644 --- a/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java +++ b/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.mxchange.jusercore.model.user.User; /** - * An event interface, fireed if a new user has registered + * An event interface, fired if a new user has registered *

* @author Roland Haeder */ diff --git a/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java b/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java new file mode 100644 index 0000000..3f2505b --- /dev/null +++ b/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jusercore.events.resendlink; + +import java.text.MessageFormat; +import org.mxchange.jusercore.model.user.User; + +/** + * An event, fired if a user has resend confirmation link + *

+ * @author Roland Haeder + */ +public class ResendLinkUserAccountEvent implements UserResendLinkAccountEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 575_412_375_267_190L; + + /** + * user resend confirmation link + */ + private final User resendLinkUser; + + /** + * Constructor with user resend confirmation link + *

+ * @param resendLinkUser User resend confirmation link + */ + public ResendLinkUserAccountEvent (final User resendLinkUser) { + // Is the confirmed user instance valid? + if (null == resendLinkUser) { + // Throw NPE + throw new NullPointerException("resendLinkUser is null"); //NOI18N + } else if (resendLinkUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("resendLinkUser.userId is null"); //NOI18N + } else if (resendLinkUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("resendLinkUser.userId={0} is invalid.", resendLinkUser.getUserId())); //NOI18N + } + + // Set it here + this.resendLinkUser = resendLinkUser; + } + + @Override + public User getResendLinkUser () { + return this.resendLinkUser; + } + +} diff --git a/src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java b/src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java new file mode 100644 index 0000000..3b9b85e --- /dev/null +++ b/src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jusercore.events.resendlink; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An event interface, fired if a user has resend confirmation link + *

+ * @author Roland Haeder + */ +public interface UserResendLinkAccountEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getResendLinkUser (); + +} -- 2.39.5