--- /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.logout;
+
+import java.io.Serializable;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An interface for events after the user has logged in
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface ObserveableUserLogoutEvent extends Serializable {
+
+ /**
+ * Getter for user instance
+ * <p>
+ * @return User instance
+ */
+ User getLoggedOutUser ();
+
+}
--- /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.logout;
+
+import java.text.MessageFormat;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * This event is fired when the loggedOutUser has logged in
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class UserLogoutEvent implements ObserveableUserLogoutEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 58_617_641_290_620L;
+
+ /**
+ * User instance
+ */
+ private final User loggedOutUser;
+
+ /**
+ * Constructor with updated loggedOutUser instance
+ * <p>
+ * @param loggedOutUser Updated loggedOutUser instance
+ */
+ public UserLogoutEvent (final User loggedOutUser) {
+ // Is the logged-in user instance valid?
+ if (null == loggedOutUser) {
+ // Throw NPE
+ throw new NullPointerException("loggedOutUser is null"); //NOI18N
+ } else if (loggedOutUser.getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("loggedOutUser.userId is null"); //NOI18N
+ } else if (loggedOutUser.getUserId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("loggedOutUser.userId={0} is invalid.", loggedOutUser.getUserId())); //NOI18N
+ }
+
+ // Set loggedOutUser
+ this.loggedOutUser = loggedOutUser;
+ }
+
+ @Override
+ public User getLoggedOutUser () {
+ return this.loggedOutUser;
+ }
+
+}