<commit_before>package org.menacheri.app;

import java.util.List;

import org.menacheri.communication.IMessageSender;
import org.menacheri.event.Events;
import org.menacheri.event.IEvent;
import org.menacheri.event.IEventDispatcher;
import org.menacheri.event.IEventHandler;


public interface ISession
{
	/**
	 * session status types
	 */
	enum Status
	{
		NOT_CONNECTED, CONNECTING, CONNECTED,CLOSED
	}

	Object getId();

	void setId(Object id);

	void setAttribute(String key, Object value);

	Object getAttribute(String key);

	void removeAttribute(String key);

	/**
     * Set connect parameter
     *
     * @param key
     * @param object
     */
    public void setConnectParameter( String key, Object object );

    /**
     * Remove connect parameter
     *
     * @param key
     */
    public void removeConnectParameter( String key );
    
    /**
     * Get connect parameter
     *
     * @param key
     * @return connect parameter
     */
    public Object getConnectParameter( String key );
    
	void onEvent(IEvent event);

	IEventDispatcher getEventDispatcher();

	void setEventDispatcher(IEventDispatcher eventDispatcher);

	boolean isWriteable();

	void setWriteable(boolean writeable);

	/**
	 * A session would not have UDP capability when created. Depending on the
	 * network abilities of the client, it can request UDP communication to be
	 * enabled with the LOGIN_UDP and CONNECT_UDP events of the {@link Events}
	 * class. Once UDP is enabled this flag will be set to true on the session.
	 * 
	 * @return Returns true if the a UDP {@link IMessageSender} instance is
	 *         attached to this session, else false.
	 */
	boolean isUDPEnabled();
	
	/**
	 * A session would not have UDP capability when created. Depending on the
	 * network abilities of the client, it can request UDP communication to be
	 * enabled with the LOGIN_UDP and CONNECT_UDP events of the {@link Events}
	 * class. Once UDP {@link IMessageSender} instance is attached to the
	 * session, this method should be called with flag to true to signal that
	 * the session is now UDP enabled.
	 * 
	 * @param isEnabled
	 *            Should be true in most use cases. It is used to signal that
	 *            the UDP {@link IMessageSender} has been attached to session.
	 */<commit_msg>Event dispatcher is now a final variable on the the session.<commit_after>package org.menacheri.app;

import java.util.List;

import org.menacheri.communication.IMessageSender;
import org.menacheri.event.Events;
import org.menacheri.event.IEvent;
import org.menacheri.event.IEventDispatcher;
import org.menacheri.event.IEventHandler;


public interface ISession
{
	/**
	 * session status types
	 */
	enum Status
	{
		NOT_CONNECTED, CONNECTING, CONNECTED,CLOSED
	}

	Object getId();

	void setId(Object id);

	void setAttribute(String key, Object value);

	Object getAttribute(String key);

	void removeAttribute(String key);

	/**
     * Set connect parameter
     *
     * @param key
     * @param object
     */
    public void setConnectParameter( String key, Object object );

    /**
     * Remove connect parameter
     *
     * @param key
     */
    public void removeConnectParameter( String key );
    
    /**
     * Get connect parameter
     *
     * @param key
     * @return connect parameter
     */
    public Object getConnectParameter( String key );
    
	void onEvent(IEvent event);

	IEventDispatcher getEventDispatcher();


	boolean isWriteable();

	void setWriteable(boolean writeable);

	/**
	 * A session would not have UDP capability when created. Depending on the
	 * network abilities of the client, it can request UDP communication to be
	 * enabled with the LOGIN_UDP and CONNECT_UDP events of the {@link Events}
	 * class. Once UDP is enabled this flag will be set to true on the session.
	 * 
	 * @return Returns true if the a UDP {@link IMessageSender} instance is
	 *         attached to this session, else false.
	 */
	boolean isUDPEnabled();
	
	/**
	 * A session would not have UDP capability when created. Depending on the
	 * network abilities of the client, it can request UDP communication to be
	 * enabled with the LOGIN_UDP and CONNECT_UDP events of the {@link Events}
	 * class. Once UDP {@link IMessageSender} instance is attached to the
	 * session, this method should be called with flag to true to signal that
	 * the session is now UDP enabled.
	 * 
	 * @param isEnabled
	 *            Should be true in most use cases. It is used to signal that
	 *            the UDP {@link IMessageSender} has been attached to session.
	 */
{'fraction_non_alphanumeric': 0.07538899846592154, 'fraction_numerical': 0.0, 'mean_word_length': 3.149090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5932616', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1222, 'n_words': 503}