/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rebelmonkey.monkeywrench.mweb.api;

/**
 *
 * @author jeffpk
 */
public interface MWEBListener {
    /**
     * This method is called when a new client connects to the system.
     * @param connectionID An ID assigned to the user that will identify this
     * connection for the duration of the connection.
     *
     * Note: Be aware of the connectionID life-cycle.  A connectionID is valid for the
     * lifetime of the connection it is assigned to.  A connectionID can be reused
     * after the connection assigned to it has been closed. A new connection
     * from the same client will get a
     * different connectionID.
     *
     * The only way tio recognize users is through either their Session or
     * an application defined protocol.
     *
     * @param connectionID The id addigend to this connection
     * @param username The login name of the user connected
     */
    void connected(long connectionID, String userName );

    /**
     * This method is called when a user is disonnected from the MWEB
     * @param connectionID This is the ID of the user who was disconnected
     * @param graceful True if this disconnection was requested by the server,
     * false if its just a dropped and timedout connection.
     */
    void disonnected(long connectionID, boolean graceful);

}
