ConnectionEvent.java

Jriver/src/org/jriver/lib/events/ConnectionEvent.java · 1.5 KB

From the archive Jriver.tar.gz

Download the archive   « Back to the archive contents

/*
 * Copyright 2007 Kevin Roe, Daniel Mccarney
 * This file is part of Jriver.
 *
 * Jriver 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.
 *
 * Jriver 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.jriver.lib.events;

import org.jriver.lib.Player;

public class ConnectionEvent
{
	public enum ConnectionState { CONNECTED, DISCONNECTED, RECONNECTED }
	private Player user = null;
	private ConnectionState newConnectionState = null;
	private String message = null;
	
	public ConnectionEvent(Player user, ConnectionState newState)
	{
		this.user = user;
		this.newConnectionState = newState;
	}
	
	public ConnectionEvent(Player user, ConnectionState newState, String message)
	{
		this(user, newState);
		this.message = message;
	}
	
	public Player queryPlayer() { return user; }
	public ConnectionState queryConnectionState() { return newConnectionState; }
	public String queryMessage() { return message; }
}

Site Stats

Snippets: 1791
Codebases: 571