package fireTester.interfaces;

import fireTester.messages.AcknowledgeMessage;
import fireTester.messages.KeepAliveMessage;
import fireTester.messages.TestUnitResults;
import fireTester.messages.TesterException;



/**
 * ResultsObservers are objects that will receive TestUnitResults as they
 * arrive to the server.
 * 
 * @author Nick Mancuso
 * 
 */
public interface ResultsObserver {
	/**
	 * Called by the client every 30 seconds to let the server know
	 * the submission is still in the queue.
	 * 
	 * @param keepAlive
	 */
	public void receive_keep_alive(KeepAliveMessage keepAlive);
	
	/**
	 * Called when a client begins execution for a submission test.
	 * 
	 * @param ack
	 */
	public void receive_acknowledge(AcknowledgeMessage ack);
	
	/**
	 * @param r the results of a test unit (test may or may not be complete,
	 * check 'continue'.
	 */
	public void receive_unit_results(TestUnitResults r);

	/**
	 * SubmissionTest failed and will not continue.
	 * 
	 * @param e the exception that was thrown 
	 */
	public void receive_test_failed(TesterException e);
	
}
