
package com.teletalk.jserver.tcp.messaging;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Interface for different implementations for dispatching a message (body).
 * 
 * @author Tobias Löfstrand
 * 
 * @since 1.2
 */
public interface MessageWriter
{
	/**
	 * Called to write a message (header and body) to an endpoint.
	 * 
	 * @param header the header of the message that is to be dispatched.
    * @param endPoint the endpoint on which the message is to be dispatched on.
	 * @param endPointOutputStream the output stream of the endpoint on which the message is to be written to.
	 */
	public void writeMessage(MessageHeader header, MessagingEndPoint endPoint, OutputStream endPointOutputStream) throws IOException;
	
	/**
	 * Gets a description of the message body (for debug).
	 */
	public String getDescription();
}