From: Roland Häder Date: Wed, 19 Apr 2017 22:55:00 +0000 (+0200) Subject: renamed to better names (Observable hints interface) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=42fe7fcbfc8329e08c86c33ddc0156c2c7c0cc76;p=juser-login-core.git renamed to better names (Observable hints interface) Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java b/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java deleted file mode 100644 index 167a936..0000000 --- a/src/org/mxchange/jusercore/events/confirmation/ConfirmedUserAccountEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.confirmation; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event, fired if a new confirmedUser has confirmed - *

- * @author Roland Häder - */ -public class ConfirmedUserAccountEvent implements UserConfirmedAccountEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 575_412_375_267_190L; - - /** - * Newly confirmed user - */ - private final User confirmedUser; - - /** - * Constructor with newly confirmed confirmedUser - *

- * @param confirmedUser Newly confirmed confirmedUser - */ - public ConfirmedUserAccountEvent (final User confirmedUser) { - // Is the confirmed user instance valid? - if (null == confirmedUser) { - // Throw NPE - throw new NullPointerException("confirmedUser is null"); //NOI18N - } else if (confirmedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("confirmedUser.userId is null"); //NOI18N - } else if (confirmedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("confirmedUser.userId={0} is invalid.", confirmedUser.getUserId())); //NOI18N - } - - // Set it here - this.confirmedUser = confirmedUser; - } - - @Override - public User getConfirmedUser () { - return this.confirmedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/confirmation/ObservableUserConfirmedAccountEvent.java b/src/org/mxchange/jusercore/events/confirmation/ObservableUserConfirmedAccountEvent.java new file mode 100644 index 0000000..903394c --- /dev/null +++ b/src/org/mxchange/jusercore/events/confirmation/ObservableUserConfirmedAccountEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.confirmation; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An event interface, fired if a new user has registered + *

+ * @author Roland Häder + */ +public interface ObservableUserConfirmedAccountEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getConfirmedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java b/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java index faa1463..e859e5e 100644 --- a/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java +++ b/src/org/mxchange/jusercore/events/confirmation/UserConfirmedAccountEvent.java @@ -16,21 +16,51 @@ */ package org.mxchange.jusercore.events.confirmation; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An event interface, fired if a new user has registered + * An event, fired if a new confirmedUser has confirmed *

* @author Roland Häder */ -public interface UserConfirmedAccountEvent extends Serializable { +public class UserConfirmedAccountEvent implements ObservableUserConfirmedAccountEvent { /** - * Getter for user instance + * Serial number + */ + private static final long serialVersionUID = 575_412_375_267_190L; + + /** + * Newly confirmed user + */ + private final User confirmedUser; + + /** + * Constructor with newly confirmed confirmedUser *

- * @return User instance + * @param confirmedUser Newly confirmed confirmedUser */ - User getConfirmedUser (); + public UserConfirmedAccountEvent (final User confirmedUser) { + // Is the confirmed user instance valid? + if (null == confirmedUser) { + // Throw NPE + throw new NullPointerException("confirmedUser is null"); //NOI18N + } else if (confirmedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("confirmedUser.userId is null"); //NOI18N + } else if (confirmedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("confirmedUser.userId={0} is invalid.", confirmedUser.getUserId())); //NOI18N + } + + // Set it here + this.confirmedUser = confirmedUser; + } + + @Override + public User getConfirmedUser () { + return this.confirmedUser; + } } diff --git a/src/org/mxchange/jusercore/events/login/ObservableUserLoggedInEvent.java b/src/org/mxchange/jusercore/events/login/ObservableUserLoggedInEvent.java new file mode 100644 index 0000000..719ddce --- /dev/null +++ b/src/org/mxchange/jusercore/events/login/ObservableUserLoggedInEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.login; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events after the user has logged in + *

+ * @author Roland Häder + */ +public interface ObservableUserLoggedInEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getLoggedInUser (); + +} diff --git a/src/org/mxchange/jusercore/events/login/UserLoggedInEvent.java b/src/org/mxchange/jusercore/events/login/UserLoggedInEvent.java index 209b7a2..fa5f93c 100644 --- a/src/org/mxchange/jusercore/events/login/UserLoggedInEvent.java +++ b/src/org/mxchange/jusercore/events/login/UserLoggedInEvent.java @@ -16,21 +16,51 @@ */ package org.mxchange.jusercore.events.login; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events after the user has logged in + * This event is fired when the loggedInUser has logged in *

* @author Roland Häder */ -public interface UserLoggedInEvent extends Serializable { +public class UserLoggedInEvent implements ObservableUserLoggedInEvent { /** - * Getter for user instance + * Serial number + */ + private static final long serialVersionUID = 163_294_958_817_560L; + + /** + * User instance + */ + private final User loggedInUser; + + /** + * Constructor with updated user instance *

- * @return User instance + * @param loggedInUser Updated user instance */ - User getLoggedInUser (); + public UserLoggedInEvent (final User loggedInUser) { + // Is the logged-in user instance valid? + if (null == loggedInUser) { + // Throw NPE + throw new NullPointerException("loggedInUser is null"); //NOI18N + } else if (loggedInUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("loggedInUser.userId is null"); //NOI18N + } else if (loggedInUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("loggedInUser.userId={0} is invalid.", loggedInUser.getUserId())); //NOI18N + } + + // Set loggedInUser + this.loggedInUser = loggedInUser; + } + + @Override + public User getLoggedInUser () { + return this.loggedInUser; + } } diff --git a/src/org/mxchange/jusercore/events/login/UserLoginEvent.java b/src/org/mxchange/jusercore/events/login/UserLoginEvent.java deleted file mode 100644 index 6dc984b..0000000 --- a/src/org/mxchange/jusercore/events/login/UserLoginEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.login; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * This event is fired when the loggedInUser has logged in - *

- * @author Roland Häder - */ -public class UserLoginEvent implements UserLoggedInEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 163_294_958_817_560L; - - /** - * User instance - */ - private final User loggedInUser; - - /** - * Constructor with updated user instance - *

- * @param loggedInUser Updated user instance - */ - public UserLoginEvent (final User loggedInUser) { - // Is the logged-in user instance valid? - if (null == loggedInUser) { - // Throw NPE - throw new NullPointerException("loggedInUser is null"); //NOI18N - } else if (loggedInUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("loggedInUser.userId is null"); //NOI18N - } else if (loggedInUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("loggedInUser.userId={0} is invalid.", loggedInUser.getUserId())); //NOI18N - } - - // Set loggedInUser - this.loggedInUser = loggedInUser; - } - - @Override - public User getLoggedInUser () { - return this.loggedInUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/logout/ObservableUserLogoutEvent.java b/src/org/mxchange/jusercore/events/logout/ObservableUserLogoutEvent.java new file mode 100644 index 0000000..13e4331 --- /dev/null +++ b/src/org/mxchange/jusercore/events/logout/ObservableUserLogoutEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.logout; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events after the user has logged in + *

+ * @author Roland Häder + */ +public interface ObservableUserLogoutEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getLoggedOutUser (); + +} diff --git a/src/org/mxchange/jusercore/events/logout/ObserveableUserLogoutEvent.java b/src/org/mxchange/jusercore/events/logout/ObserveableUserLogoutEvent.java deleted file mode 100644 index effafc8..0000000 --- a/src/org/mxchange/jusercore/events/logout/ObserveableUserLogoutEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.logout; - -import java.io.Serializable; -import org.mxchange.jusercore.model.user.User; - -/** - * An interface for events after the user has logged in - *

- * @author Roland Häder - */ -public interface ObserveableUserLogoutEvent extends Serializable { - - /** - * Getter for user instance - *

- * @return User instance - */ - User getLoggedOutUser (); - -} diff --git a/src/org/mxchange/jusercore/events/logout/UserLogoutEvent.java b/src/org/mxchange/jusercore/events/logout/UserLogoutEvent.java index 3ecb1b2..986d056 100644 --- a/src/org/mxchange/jusercore/events/logout/UserLogoutEvent.java +++ b/src/org/mxchange/jusercore/events/logout/UserLogoutEvent.java @@ -24,7 +24,7 @@ import org.mxchange.jusercore.model.user.User; *

* @author Roland Häder */ -public class UserLogoutEvent implements ObserveableUserLogoutEvent { +public class UserLogoutEvent implements ObservableUserLogoutEvent { /** * Serial number diff --git a/src/org/mxchange/jusercore/events/registration/ObservableUserRegisteredEvent.java b/src/org/mxchange/jusercore/events/registration/ObservableUserRegisteredEvent.java new file mode 100644 index 0000000..3ca2e16 --- /dev/null +++ b/src/org/mxchange/jusercore/events/registration/ObservableUserRegisteredEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.registration; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An event interface, fired if a new user has registered + *

+ * @author Roland Häder + */ +public interface ObservableUserRegisteredEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getRegisteredUser (); + +} diff --git a/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java b/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java deleted file mode 100644 index d0d3e9a..0000000 --- a/src/org/mxchange/jusercore/events/registration/RegisteredUserEvent.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.registration; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event, fired if a new registeredUser has registered - *

- * @author Roland Häder - */ -public class RegisteredUserEvent implements UserRegisteredEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 186_956_974_127_691L; - - /** - * Newly registered registeredUser; - */ - private final User registeredUser; - - /** - * Constructor with newly registered registeredUser - *

- * @param registeredUser Newly registered registeredUser - */ - public RegisteredUserEvent (final User registeredUser) { - // Is the registered user instance valid? - if (null == registeredUser) { - // Throw NPE - throw new NullPointerException("registeredUser is null"); //NOI18N - } else if (registeredUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("registeredUser.userId is null"); //NOI18N - } else if (registeredUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("registeredUser.userId={0} is invalid.", registeredUser.getUserId())); //NOI18N - } - - // Set it here - this.registeredUser = registeredUser; - } - - /** - * Getter for registeredUser instance - *

- * @return User instance - */ - @Override - public User getRegisteredUser () { - return this.registeredUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java b/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java index 5bad60c..5381223 100644 --- a/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java +++ b/src/org/mxchange/jusercore/events/registration/UserRegisteredEvent.java @@ -16,21 +16,56 @@ */ package org.mxchange.jusercore.events.registration; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An event interface, fired if a new user has registered + * An event, fired if a new registeredUser has registered *

* @author Roland Häder */ -public interface UserRegisteredEvent extends Serializable { +public class UserRegisteredEvent implements ObservableUserRegisteredEvent { /** - * Getter for user instance + * Serial number + */ + private static final long serialVersionUID = 186_956_974_127_691L; + + /** + * Newly registered registeredUser; + */ + private final User registeredUser; + + /** + * Constructor with newly registered registeredUser + *

+ * @param registeredUser Newly registered registeredUser + */ + public UserRegisteredEvent (final User registeredUser) { + // Is the registered user instance valid? + if (null == registeredUser) { + // Throw NPE + throw new NullPointerException("registeredUser is null"); //NOI18N + } else if (registeredUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("registeredUser.userId is null"); //NOI18N + } else if (registeredUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("registeredUser.userId={0} is invalid.", registeredUser.getUserId())); //NOI18N + } + + // Set it here + this.registeredUser = registeredUser; + } + + /** + * Getter for registeredUser instance *

* @return User instance */ - User getRegisteredUser (); + @Override + public User getRegisteredUser () { + return this.registeredUser; + } } diff --git a/src/org/mxchange/jusercore/events/resendlink/ObservableUserResendLinkAccountEvent.java b/src/org/mxchange/jusercore/events/resendlink/ObservableUserResendLinkAccountEvent.java new file mode 100644 index 0000000..b6055b0 --- /dev/null +++ b/src/org/mxchange/jusercore/events/resendlink/ObservableUserResendLinkAccountEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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 Häder + */ +public interface ObservableUserResendLinkAccountEvent extends Serializable { + + /** + * Getter for user instance + *

+ * @return User instance + */ + User getResendLinkUser (); + +} diff --git a/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java b/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java deleted file mode 100644 index 884e622..0000000 --- a/src/org/mxchange/jusercore/events/resendlink/ResendLinkUserAccountEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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 Häder - */ -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 index efae54b..65d0e4b 100644 --- a/src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java +++ b/src/org/mxchange/jusercore/events/resendlink/UserResendLinkAccountEvent.java @@ -16,21 +16,51 @@ */ package org.mxchange.jusercore.events.resendlink; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An event interface, fired if a user has resend confirmation link + * An event, fired if a user has resend confirmation link *

* @author Roland Häder */ -public interface UserResendLinkAccountEvent extends Serializable { +public class UserResendLinkAccountEvent implements ObservableUserResendLinkAccountEvent { /** - * Getter for user instance + * 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 *

- * @return User instance + * @param resendLinkUser User resend confirmation link */ - User getResendLinkUser (); + public UserResendLinkAccountEvent (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/user/add/AdminAddedUserEvent.java b/src/org/mxchange/jusercore/events/user/add/AdminAddedUserEvent.java index 65c8a6a..68e33f3 100644 --- a/src/org/mxchange/jusercore/events/user/add/AdminAddedUserEvent.java +++ b/src/org/mxchange/jusercore/events/user/add/AdminAddedUserEvent.java @@ -16,22 +16,51 @@ */ package org.mxchange.jusercore.events.user.add; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator added a new user - * account. + * An event being fired when the administrator has added a new user account *

* @author Roland Häder */ -public interface AdminAddedUserEvent extends Serializable { +public class AdminAddedUserEvent implements ObservableAdminAddedUserEvent { /** - * Getter for added user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Added user instance + */ + private final User addedUser; + + /** + * Constructor with added user instance *

- * @return Added user instance + * @param addedUser Added user instance */ - User getAddedUser (); + public AdminAddedUserEvent (final User addedUser) { + // Is the user instance valid? + if (null == addedUser) { + // Throw NPE + throw new NullPointerException("addedUser is null"); //NOI18N + } else if (addedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("addedUser.userId is null"); //NOI18N + } else if (addedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("addedUser.userId={0} is invalid.", addedUser.getUserId())); //NOI18N + } + + // Set it here + this.addedUser = addedUser; + } + + @Override + public User getAddedUser () { + return this.addedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/add/AdminUserAddedEvent.java b/src/org/mxchange/jusercore/events/user/add/AdminUserAddedEvent.java deleted file mode 100644 index 5d53ab0..0000000 --- a/src/org/mxchange/jusercore/events/user/add/AdminUserAddedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.add; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has added a new user account - *

- * @author Roland Häder - */ -public class AdminUserAddedEvent implements AdminAddedUserEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Added user instance - */ - private final User addedUser; - - /** - * Constructor with added user instance - *

- * @param addedUser Added user instance - */ - public AdminUserAddedEvent (final User addedUser) { - // Is the user instance valid? - if (null == addedUser) { - // Throw NPE - throw new NullPointerException("addedUser is null"); //NOI18N - } else if (addedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("addedUser.userId is null"); //NOI18N - } else if (addedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("addedUser.userId={0} is invalid.", addedUser.getUserId())); //NOI18N - } - - // Set it here - this.addedUser = addedUser; - } - - @Override - public User getAddedUser () { - return this.addedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/add/ObservableAdminAddedUserEvent.java b/src/org/mxchange/jusercore/events/user/add/ObservableAdminAddedUserEvent.java new file mode 100644 index 0000000..c26afb6 --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/add/ObservableAdminAddedUserEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.add; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator added a new user + * account. + *

+ * @author Roland Häder + */ +public interface ObservableAdminAddedUserEvent extends Serializable { + + /** + * Getter for added user instance + *

+ * @return Added user instance + */ + User getAddedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/delete/AdminDeletedUserEvent.java b/src/org/mxchange/jusercore/events/user/delete/AdminDeletedUserEvent.java index 96fe260..7526073 100644 --- a/src/org/mxchange/jusercore/events/user/delete/AdminDeletedUserEvent.java +++ b/src/org/mxchange/jusercore/events/user/delete/AdminDeletedUserEvent.java @@ -16,29 +16,63 @@ */ package org.mxchange.jusercore.events.user.delete; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator added a new user - * account. + * An event being fired when the administrator has deleted a user account *

* @author Roland Häder */ -public interface AdminDeletedUserEvent extends Serializable { +public class AdminDeletedUserEvent implements ObservableAdminDeletedUserEvent { /** - * Getter for deleted user instance - *

- * @return Deleted user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Deleted user instance + */ + private final User deletedUser; + + /** + * Delete reason */ - User getDeletedUser (); + private final String userDeleteReason; /** - * Getter for user delete reason + * Constructor with deleted user instance *

- * @return User delete reason + * @param deletedUser Deleted user instance + * @param userDeleteReason Delete reason */ - String getUserDeleteReason (); + public AdminDeletedUserEvent (final User deletedUser, final String userDeleteReason) { + // Is the user instance valid? + if (null == deletedUser) { + // Throw NPE + throw new NullPointerException("deletedUser is null"); //NOI18N + } else if (deletedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("deletedUser.userId is null"); //NOI18N + } else if (deletedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("deletedUser.userId={0} is invalid.", deletedUser.getUserId())); //NOI18N + } + + // Set it here + this.deletedUser = deletedUser; + this.userDeleteReason = userDeleteReason; + } + + @Override + public User getDeletedUser () { + return this.deletedUser; + } + + @Override + public String getUserDeleteReason () { + return this.userDeleteReason; + } } diff --git a/src/org/mxchange/jusercore/events/user/delete/AdminUserDeletedEvent.java b/src/org/mxchange/jusercore/events/user/delete/AdminUserDeletedEvent.java deleted file mode 100644 index 31d29a6..0000000 --- a/src/org/mxchange/jusercore/events/user/delete/AdminUserDeletedEvent.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.delete; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has deleted a user account - *

- * @author Roland Häder - */ -public class AdminUserDeletedEvent implements AdminDeletedUserEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Deleted user instance - */ - private final User deletedUser; - - /** - * Delete reason - */ - private final String userDeleteReason; - - /** - * Constructor with deleted user instance - *

- * @param deletedUser Deleted user instance - * @param userDeleteReason Delete reason - */ - public AdminUserDeletedEvent (final User deletedUser, final String userDeleteReason) { - // Is the user instance valid? - if (null == deletedUser) { - // Throw NPE - throw new NullPointerException("deletedUser is null"); //NOI18N - } else if (deletedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("deletedUser.userId is null"); //NOI18N - } else if (deletedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("deletedUser.userId={0} is invalid.", deletedUser.getUserId())); //NOI18N - } - - // Set it here - this.deletedUser = deletedUser; - this.userDeleteReason = userDeleteReason; - } - - @Override - public User getDeletedUser () { - return this.deletedUser; - } - - @Override - public String getUserDeleteReason () { - return this.userDeleteReason; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/delete/ObservableAdminDeletedUserEvent.java b/src/org/mxchange/jusercore/events/user/delete/ObservableAdminDeletedUserEvent.java new file mode 100644 index 0000000..51079ac --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/delete/ObservableAdminDeletedUserEvent.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.delete; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator added a new user + * account. + *

+ * @author Roland Häder + */ +public interface ObservableAdminDeletedUserEvent extends Serializable { + + /** + * Getter for deleted user instance + *

+ * @return Deleted user instance + */ + User getDeletedUser (); + + /** + * Getter for user delete reason + *

+ * @return User delete reason + */ + String getUserDeleteReason (); + +} diff --git a/src/org/mxchange/jusercore/events/user/linked/AdminLinkedUserEvent.java b/src/org/mxchange/jusercore/events/user/linked/AdminLinkedUserEvent.java index 14adfb4..7dc5383 100644 --- a/src/org/mxchange/jusercore/events/user/linked/AdminLinkedUserEvent.java +++ b/src/org/mxchange/jusercore/events/user/linked/AdminLinkedUserEvent.java @@ -16,22 +16,52 @@ */ package org.mxchange.jusercore.events.user.linked; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator linked a new user - * account with existing contact data. + * An event being fired when the administrator has linked a new user account + * with existing contact data. *

* @author Roland Häder */ -public interface AdminLinkedUserEvent extends Serializable { +public class AdminLinkedUserEvent implements ObservableAdminLinkedUserEvent { /** - * Getter for linked user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Linked user instance + */ + private final User linkedUser; + + /** + * Constructor with linked user instance *

- * @return linked user instance + * @param linkedUser Linked user instance */ - User getLinkedUser (); + public AdminLinkedUserEvent (final User linkedUser) { + // Is the user instance valid? + if (null == linkedUser) { + // Throw NPE + throw new NullPointerException("linkedUser is null"); //NOI18N + } else if (linkedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("linkedUser.userId is null"); //NOI18N + } else if (linkedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("linkedUser.userId={0} is invalid.", linkedUser.getUserId())); //NOI18N + } + + // Set it here + this.linkedUser = linkedUser; + } + + @Override + public User getLinkedUser () { + return this.linkedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/linked/AdminUserLinkedEvent.java b/src/org/mxchange/jusercore/events/user/linked/AdminUserLinkedEvent.java deleted file mode 100644 index 8b067b9..0000000 --- a/src/org/mxchange/jusercore/events/user/linked/AdminUserLinkedEvent.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.linked; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has linked a new user account - * with existing contact data. - *

- * @author Roland Häder - */ -public class AdminUserLinkedEvent implements AdminLinkedUserEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Linked user instance - */ - private final User linkedUser; - - /** - * Constructor with linked user instance - *

- * @param linkedUser Linked user instance - */ - public AdminUserLinkedEvent (final User linkedUser) { - // Is the user instance valid? - if (null == linkedUser) { - // Throw NPE - throw new NullPointerException("linkedUser is null"); //NOI18N - } else if (linkedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("linkedUser.userId is null"); //NOI18N - } else if (linkedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("linkedUser.userId={0} is invalid.", linkedUser.getUserId())); //NOI18N - } - - // Set it here - this.linkedUser = linkedUser; - } - - @Override - public User getLinkedUser () { - return this.linkedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/linked/ObservableAdminLinkedUserEvent.java b/src/org/mxchange/jusercore/events/user/linked/ObservableAdminLinkedUserEvent.java new file mode 100644 index 0000000..bb33592 --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/linked/ObservableAdminLinkedUserEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.linked; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator linked a new user + * account with existing contact data. + *

+ * @author Roland Häder + */ +public interface ObservableAdminLinkedUserEvent extends Serializable { + + /** + * Getter for linked user instance + *

+ * @return linked user instance + */ + User getLinkedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/locked/AdminLockedUserEvent.java b/src/org/mxchange/jusercore/events/user/locked/AdminLockedUserEvent.java index 001aaf3..bc21cee 100644 --- a/src/org/mxchange/jusercore/events/user/locked/AdminLockedUserEvent.java +++ b/src/org/mxchange/jusercore/events/user/locked/AdminLockedUserEvent.java @@ -16,22 +16,51 @@ */ package org.mxchange.jusercore.events.user.locked; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator locked a user - * account. + * An event being fired when the administrator has locked a user account. *

* @author Roland Häder */ -public interface AdminLockedUserEvent extends Serializable { +public class AdminLockedUserEvent implements ObservableAdminLockedUserEvent { /** - * Getter for locked user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Locked user instance + */ + private final User lockedUser; + + /** + * Constructor with linked user instance *

- * @return locked user instance + * @param lockedUser Locked user instance */ - User getLockedUser (); + public AdminLockedUserEvent (final User lockedUser) { + // Is the user instance valid? + if (null == lockedUser) { + // Throw NPE + throw new NullPointerException("lockedUser is null"); //NOI18N + } else if (lockedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("lockedUser.userId is null"); //NOI18N + } else if (lockedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("lockedUser.userId={0} is invalid.", lockedUser.getUserId())); //NOI18N + } + + // Set it here + this.lockedUser = lockedUser; + } + + @Override + public User getLockedUser () { + return this.lockedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/locked/AdminUserLockedEvent.java b/src/org/mxchange/jusercore/events/user/locked/AdminUserLockedEvent.java deleted file mode 100644 index 4f81edf..0000000 --- a/src/org/mxchange/jusercore/events/user/locked/AdminUserLockedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.locked; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has locked a user account. - *

- * @author Roland Häder - */ -public class AdminUserLockedEvent implements AdminLockedUserEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Locked user instance - */ - private final User lockedUser; - - /** - * Constructor with linked user instance - *

- * @param lockedUser Locked user instance - */ - public AdminUserLockedEvent (final User lockedUser) { - // Is the user instance valid? - if (null == lockedUser) { - // Throw NPE - throw new NullPointerException("lockedUser is null"); //NOI18N - } else if (lockedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("lockedUser.userId is null"); //NOI18N - } else if (lockedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("lockedUser.userId={0} is invalid.", lockedUser.getUserId())); //NOI18N - } - - // Set it here - this.lockedUser = lockedUser; - } - - @Override - public User getLockedUser () { - return this.lockedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/locked/ObservableAdminLockedUserEvent.java b/src/org/mxchange/jusercore/events/user/locked/ObservableAdminLockedUserEvent.java new file mode 100644 index 0000000..ac8bf5e --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/locked/ObservableAdminLockedUserEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.locked; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator locked a user + * account. + *

+ * @author Roland Häder + */ +public interface ObservableAdminLockedUserEvent extends Serializable { + + /** + * Getter for locked user instance + *

+ * @return locked user instance + */ + User getLockedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/password_change/ObservableUpdatedUserPasswordEvent.java b/src/org/mxchange/jusercore/events/user/password_change/ObservableUpdatedUserPasswordEvent.java new file mode 100644 index 0000000..c19a47a --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/password_change/ObservableUpdatedUserPasswordEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.password_change; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.password_history.PasswordHistory; + +/** + * An interface for events being fired when a user updates personal data. + *

+ * @author Roland Häder + */ +public interface ObservableUpdatedUserPasswordEvent extends Serializable { + + /** + * Getter for password history entry + *

+ * @return Password history entry + */ + PasswordHistory getPasswordHistory (); + +} diff --git a/src/org/mxchange/jusercore/events/user/password_change/UpdatedUserPasswordEvent.java b/src/org/mxchange/jusercore/events/user/password_change/UpdatedUserPasswordEvent.java index 48cc588..6213f1e 100644 --- a/src/org/mxchange/jusercore/events/user/password_change/UpdatedUserPasswordEvent.java +++ b/src/org/mxchange/jusercore/events/user/password_change/UpdatedUserPasswordEvent.java @@ -16,21 +16,54 @@ */ package org.mxchange.jusercore.events.user.password_change; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.password_history.PasswordHistory; /** - * An interface for events being fired when a user updates personal data. + * An event being fired when the user has updated personal data *

* @author Roland Häder */ -public interface UpdatedUserPasswordEvent extends Serializable { +public class UpdatedUserPasswordEvent implements ObservableUpdatedUserPasswordEvent { /** - * Getter for password history entry + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Updated user instance + */ + private final PasswordHistory passwordHistory; + + /** + * Constructor with updated user instance *

- * @return Password history entry + * @param passwordHistory Updated user instance */ - PasswordHistory getPasswordHistory (); + public UpdatedUserPasswordEvent (final PasswordHistory passwordHistory) { + // Is the user instance valid? + if (null == passwordHistory) { + // Throw NPE + throw new NullPointerException("passwordHistory is null"); //NOI18N + } else if (passwordHistory.getUserPasswordHistoryUser() == null) { + // Throw NPE again + throw new NullPointerException("passwordHistory.userPasswordHistoryUser is null"); //NOI18N + } else if (passwordHistory.getUserPasswordHistoryUser().getUserId() == null) { + // Throw NPE again + throw new NullPointerException("passwordHistory.userPasswordHistoryUser.userId is null"); //NOI18N + } else if (passwordHistory.getUserPasswordHistoryUser().getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("passwordHistory.userPasswordHistoryUser.userId={0} is invalid.", passwordHistory.getUserPasswordHistoryUser().getUserId())); //NOI18N + } + + // Set it here + this.passwordHistory = passwordHistory; + } + + @Override + public PasswordHistory getPasswordHistory () { + return this.passwordHistory; + } } diff --git a/src/org/mxchange/jusercore/events/user/password_change/UserUpdatedPasswordEvent.java b/src/org/mxchange/jusercore/events/user/password_change/UserUpdatedPasswordEvent.java deleted file mode 100644 index 166c76c..0000000 --- a/src/org/mxchange/jusercore/events/user/password_change/UserUpdatedPasswordEvent.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.password_change; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.password_history.PasswordHistory; - -/** - * An event being fired when the user has updated personal data - *

- * @author Roland Häder - */ -public class UserUpdatedPasswordEvent implements UpdatedUserPasswordEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Updated user instance - */ - private final PasswordHistory passwordHistory; - - /** - * Constructor with updated user instance - *

- * @param passwordHistory Updated user instance - */ - public UserUpdatedPasswordEvent (final PasswordHistory passwordHistory) { - // Is the user instance valid? - if (null == passwordHistory) { - // Throw NPE - throw new NullPointerException("passwordHistory is null"); //NOI18N - } else if (passwordHistory.getUserPasswordHistoryUser() == null) { - // Throw NPE again - throw new NullPointerException("passwordHistory.userPasswordHistoryUser is null"); //NOI18N - } else if (passwordHistory.getUserPasswordHistoryUser().getUserId() == null) { - // Throw NPE again - throw new NullPointerException("passwordHistory.userPasswordHistoryUser.userId is null"); //NOI18N - } else if (passwordHistory.getUserPasswordHistoryUser().getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("passwordHistory.userPasswordHistoryUser.userId={0} is invalid.", passwordHistory.getUserPasswordHistoryUser().getUserId())); //NOI18N - } - - // Set it here - this.passwordHistory = passwordHistory; - } - - @Override - public PasswordHistory getPasswordHistory () { - return this.passwordHistory; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/unlocked/AdminUnlockedUserEvent.java b/src/org/mxchange/jusercore/events/user/unlocked/AdminUnlockedUserEvent.java index f321d83..81cfc88 100644 --- a/src/org/mxchange/jusercore/events/user/unlocked/AdminUnlockedUserEvent.java +++ b/src/org/mxchange/jusercore/events/user/unlocked/AdminUnlockedUserEvent.java @@ -16,22 +16,51 @@ */ package org.mxchange.jusercore.events.user.unlocked; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator unlocked a user - * account. + * An event being fired when the administrator has unlocked a user account. *

* @author Roland Häder */ -public interface AdminUnlockedUserEvent extends Serializable { +public class AdminUnlockedUserEvent implements ObservableAdminUnlockedUserEvent { /** - * Getter for unlocked user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Unlocked user instance + */ + private final User unlockedUser; + + /** + * Constructor with linked user instance *

- * @return Unlocked user instance + * @param unlockedUser Unlocked user instance */ - User getUnlockedUser (); + public AdminUnlockedUserEvent (final User unlockedUser) { + // Is the user instance valid? + if (null == unlockedUser) { + // Throw NPE + throw new NullPointerException("unlockedUser is null"); //NOI18N + } else if (unlockedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("unlockedUser.userId is null"); //NOI18N + } else if (unlockedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("unlockedUser.userId={0} is invalid.", unlockedUser.getUserId())); //NOI18N + } + + // Set it here + this.unlockedUser = unlockedUser; + } + + @Override + public User getUnlockedUser () { + return this.unlockedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/unlocked/AdminUserUnlockedEvent.java b/src/org/mxchange/jusercore/events/user/unlocked/AdminUserUnlockedEvent.java deleted file mode 100644 index 57cf3a5..0000000 --- a/src/org/mxchange/jusercore/events/user/unlocked/AdminUserUnlockedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.unlocked; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has unlocked a user account. - *

- * @author Roland Häder - */ -public class AdminUserUnlockedEvent implements AdminUnlockedUserEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Unlocked user instance - */ - private final User unlockedUser; - - /** - * Constructor with linked user instance - *

- * @param unlockedUser Unlocked user instance - */ - public AdminUserUnlockedEvent (final User unlockedUser) { - // Is the user instance valid? - if (null == unlockedUser) { - // Throw NPE - throw new NullPointerException("unlockedUser is null"); //NOI18N - } else if (unlockedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("unlockedUser.userId is null"); //NOI18N - } else if (unlockedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("unlockedUser.userId={0} is invalid.", unlockedUser.getUserId())); //NOI18N - } - - // Set it here - this.unlockedUser = unlockedUser; - } - - @Override - public User getUnlockedUser () { - return this.unlockedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/unlocked/ObservableAdminUnlockedUserEvent.java b/src/org/mxchange/jusercore/events/user/unlocked/ObservableAdminUnlockedUserEvent.java new file mode 100644 index 0000000..ecfd1f1 --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/unlocked/ObservableAdminUnlockedUserEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.unlocked; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator unlocked a user + * account. + *

+ * @author Roland Häder + */ +public interface ObservableAdminUnlockedUserEvent extends Serializable { + + /** + * Getter for unlocked user instance + *

+ * @return Unlocked user instance + */ + User getUnlockedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/update/AdminUpdatedUserDataEvent.java b/src/org/mxchange/jusercore/events/user/update/AdminUpdatedUserDataEvent.java index 0f936e1..db617ad 100644 --- a/src/org/mxchange/jusercore/events/user/update/AdminUpdatedUserDataEvent.java +++ b/src/org/mxchange/jusercore/events/user/update/AdminUpdatedUserDataEvent.java @@ -16,21 +16,51 @@ */ package org.mxchange.jusercore.events.user.update; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when an administrator updated user data. + * An event being fired when the administrator has updated user data *

* @author Roland Häder */ -public interface AdminUpdatedUserDataEvent extends Serializable { +public class AdminUpdatedUserDataEvent implements ObservableAdminUpdatedUserDataEvent { /** - * Getter for updated user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Updated user instance + */ + private final User updatedUser; + + /** + * Constructor with updated user instance *

- * @return Added user instance + * @param updatedUser Updated user instance */ - User getUpdatedUser (); + public AdminUpdatedUserDataEvent (final User updatedUser) { + // Is the user instance valid? + if (null == updatedUser) { + // Throw NPE + throw new NullPointerException("updatedUser is null"); //NOI18N + } else if (updatedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("updatedUser.userId is null"); //NOI18N + } else if (updatedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("updatedUser.userId={0} is invalid.", updatedUser.getUserId())); //NOI18N + } + + // Set it here + this.updatedUser = updatedUser; + } + + @Override + public User getUpdatedUser () { + return this.updatedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/update/AdminUserDataUpdatedEvent.java b/src/org/mxchange/jusercore/events/user/update/AdminUserDataUpdatedEvent.java deleted file mode 100644 index e913ef4..0000000 --- a/src/org/mxchange/jusercore/events/user/update/AdminUserDataUpdatedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.update; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the administrator has updated user data - *

- * @author Roland Häder - */ -public class AdminUserDataUpdatedEvent implements AdminUpdatedUserDataEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Updated user instance - */ - private final User updatedUser; - - /** - * Constructor with updated user instance - *

- * @param updatedUser Updated user instance - */ - public AdminUserDataUpdatedEvent (final User updatedUser) { - // Is the user instance valid? - if (null == updatedUser) { - // Throw NPE - throw new NullPointerException("updatedUser is null"); //NOI18N - } else if (updatedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("updatedUser.userId is null"); //NOI18N - } else if (updatedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("updatedUser.userId={0} is invalid.", updatedUser.getUserId())); //NOI18N - } - - // Set it here - this.updatedUser = updatedUser; - } - - @Override - public User getUpdatedUser () { - return this.updatedUser; - } - -} diff --git a/src/org/mxchange/jusercore/events/user/update/ObservableAdminUpdatedUserDataEvent.java b/src/org/mxchange/jusercore/events/user/update/ObservableAdminUpdatedUserDataEvent.java new file mode 100644 index 0000000..6697b97 --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/update/ObservableAdminUpdatedUserDataEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.update; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when an administrator updated user data. + *

+ * @author Roland Häder + */ +public interface ObservableAdminUpdatedUserDataEvent extends Serializable { + + /** + * Getter for updated user instance + *

+ * @return Added user instance + */ + User getUpdatedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/update/ObservableUpdatedUserPersonalDataEvent.java b/src/org/mxchange/jusercore/events/user/update/ObservableUpdatedUserPersonalDataEvent.java new file mode 100644 index 0000000..fd2b7ad --- /dev/null +++ b/src/org/mxchange/jusercore/events/user/update/ObservableUpdatedUserPersonalDataEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Roland Häder + * + * 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.user.update; + +import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; + +/** + * An interface for events being fired when a user updates personal data. + *

+ * @author Roland Häder + */ +public interface ObservableUpdatedUserPersonalDataEvent extends Serializable { + + /** + * Getter for updated user instance + *

+ * @return Added user instance + */ + User getUpdatedUser (); + +} diff --git a/src/org/mxchange/jusercore/events/user/update/UpdatedUserPersonalDataEvent.java b/src/org/mxchange/jusercore/events/user/update/UpdatedUserPersonalDataEvent.java index 31770fb..a7ea086 100644 --- a/src/org/mxchange/jusercore/events/user/update/UpdatedUserPersonalDataEvent.java +++ b/src/org/mxchange/jusercore/events/user/update/UpdatedUserPersonalDataEvent.java @@ -16,21 +16,51 @@ */ package org.mxchange.jusercore.events.user.update; -import java.io.Serializable; +import java.text.MessageFormat; import org.mxchange.jusercore.model.user.User; /** - * An interface for events being fired when a user updates personal data. + * An event being fired when the user has updated personal data *

* @author Roland Häder */ -public interface UpdatedUserPersonalDataEvent extends Serializable { +public class UpdatedUserPersonalDataEvent implements ObservableUpdatedUserPersonalDataEvent { /** - * Getter for updated user instance + * Serial number + */ + private static final long serialVersionUID = 14_785_787_174_676_290L; + + /** + * Updated user instance + */ + private final User updatedUser; + + /** + * Constructor with updated user instance *

- * @return Added user instance + * @param updatedUser Updated user instance */ - User getUpdatedUser (); + public UpdatedUserPersonalDataEvent (final User updatedUser) { + // Is the user instance valid? + if (null == updatedUser) { + // Throw NPE + throw new NullPointerException("updatedUser is null"); //NOI18N + } else if (updatedUser.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("updatedUser.userId is null"); //NOI18N + } else if (updatedUser.getUserId() < 1) { + // Invalid id number + throw new IllegalArgumentException(MessageFormat.format("updatedUser.userId={0} is invalid.", updatedUser.getUserId())); //NOI18N + } + + // Set it here + this.updatedUser = updatedUser; + } + + @Override + public User getUpdatedUser () { + return this.updatedUser; + } } diff --git a/src/org/mxchange/jusercore/events/user/update/UserUpdatedPersonalDataEvent.java b/src/org/mxchange/jusercore/events/user/update/UserUpdatedPersonalDataEvent.java deleted file mode 100644 index ff51c82..0000000 --- a/src/org/mxchange/jusercore/events/user/update/UserUpdatedPersonalDataEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2016 Roland Häder - * - * 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.user.update; - -import java.text.MessageFormat; -import org.mxchange.jusercore.model.user.User; - -/** - * An event being fired when the user has updated personal data - *

- * @author Roland Häder - */ -public class UserUpdatedPersonalDataEvent implements UpdatedUserPersonalDataEvent { - - /** - * Serial number - */ - private static final long serialVersionUID = 14_785_787_174_676_290L; - - /** - * Updated user instance - */ - private final User updatedUser; - - /** - * Constructor with updated user instance - *

- * @param updatedUser Updated user instance - */ - public UserUpdatedPersonalDataEvent (final User updatedUser) { - // Is the user instance valid? - if (null == updatedUser) { - // Throw NPE - throw new NullPointerException("updatedUser is null"); //NOI18N - } else if (updatedUser.getUserId() == null) { - // Throw NPE again - throw new NullPointerException("updatedUser.userId is null"); //NOI18N - } else if (updatedUser.getUserId() < 1) { - // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("updatedUser.userId={0} is invalid.", updatedUser.getUserId())); //NOI18N - } - - // Set it here - this.updatedUser = updatedUser; - } - - @Override - public User getUpdatedUser () { - return this.updatedUser; - } - -}