--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminLockedUserEvent extends Serializable {
+
+ /**
+ * Getter for locked user instance
+ * <p>
+ * @return locked user instance
+ */
+ User getLockedUser ();
+
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+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
+ * <p>
+ * @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;
+ }
+
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface AdminUnlockedUserEvent extends Serializable {
+
+ /**
+ * Getter for unlocked user instance
+ * <p>
+ * @return Unlocked user instance
+ */
+ User getUnlockedUser ();
+
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+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.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+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
+ * <p>
+ * @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;
+ }
+
+}