/**
 * Created Jun 13, 2008
 */
package com.crawljax.core;

import java.util.ArrayList;
import java.util.List;

import com.crawljax.browser.EmbeddedBrowser;
import com.crawljax.core.configuration.CrawljaxConfigurationReader;
import com.crawljax.core.state.Eventable;
import com.crawljax.core.state.StateFlowGraph;
import com.crawljax.core.state.StateVertix;

/**
 * The data about the crawlsession.
 * 
 * @author mesbah
 * @version $Id$
 */
public class CrawlSession {

	private final EmbeddedBrowser browser;
	private final StateFlowGraph stateFlowGraph;
	private final List<List<Eventable>> crawlPaths = new ArrayList<List<Eventable>>();
	private StateVertix currentState;
	private final StateVertix initialState;
	private final CrawljaxConfigurationReader crawljaxConfiguration;
	private final long startTime;

	/**
	 * @param browser
	 *            the Embedded browser.
	 */
	public CrawlSession(EmbeddedBrowser browser) {
		this(browser, null, null, 0);
	}

	/**
	 * @param browser
	 *            the embedded browser instance.
	 * @param stateFlowGraph
	 *            the state flow graph.
	 * @param state
	 *            the current state.
	 * @param startTime
	 *            the time this session started in milliseconds.
	 */
	public CrawlSession(EmbeddedBrowser browser, StateFlowGraph stateFlowGraph,
	        StateVertix state, long startTime) {
		this(browser, stateFlowGraph, state, startTime, null);
	}

	/**
	 * @param browser
	 *            the embedded browser instance.
	 * @param stateFlowGraph
	 *            the state flow graph
	 * @param state
	 *            the current state.
	 * @param startTime
	 *            the time this session started in milliseconds.
	 * @param crawljaxConfiguration
	 *            the configuration.
	 */
	public CrawlSession(EmbeddedBrowser browser, StateFlowGraph stateFlowGraph,
	        StateVertix state, long startTime, CrawljaxConfigurationReader crawljaxConfiguration) {
		this.crawljaxConfiguration = crawljaxConfiguration;
		this.browser = browser;
		this.stateFlowGraph = stateFlowGraph;
		this.currentState = state;
		this.initialState = state;
		this.startTime = startTime;
	}

	/**
	 * @return the browser
	 */
	public EmbeddedBrowser getBrowser() {
		return browser;
	}

	/**
	 * @return the stateFlowGraph
	 */
	public StateFlowGraph getStateFlowGraph() {
		return stateFlowGraph;
	}

	/**
	 * @return the currentState
	 */
	public StateVertix getCurrentState() {
		return currentState;
	}

	/**
	 * @param currentState
	 *            the currentState to set
	 */
	public void setCurrentState(StateVertix currentState) {
		this.currentState = currentState;
	}

	/**
	 * @return the crawlPaths
	 */
	public List<List<Eventable>> getCrawlPaths() {
		return crawlPaths;
	}

	/**
	 * @param crawlPath
	 *            the eventable list
	 */
	public void addCrawlPath(List<Eventable> crawlPath) {
		this.crawlPaths.add(crawlPath);
	}

	/**
	 * @return the crawljaxConfiguration
	 */
	public CrawljaxConfigurationReader getCrawljaxConfiguration() {
		return crawljaxConfiguration;
	}

	/**
	 * @return the initialState
	 */
	public final StateVertix getInitialState() {
		return initialState;
	}

	/**
	 * @return the startTime
	 */
	public final long getStartTime() {
		return startTime;
	}

}

@@ -806,16 +806,57 @@
 artTime;
+%0A%09private List%3CEventable%3E exactEventPath;
 %0A%0A%09/**%0A%09
@@ -3290,10 +3290,312 @@
 me;%0A%09%7D%0A%0A
+%09/**%0A%09 * @return the exactEventPath%0A%09 */%0A%09public List%3CEventable%3E getExactEventPath() %7B%0A%09%09return exactEventPath;%0A%09%7D%0A%0A%09/**%0A%09 * @param exactEventPath%0A%09 *            the exactEventPath to set%0A%09 */%0A%09public void setExactEventPath(List%3CEventable%3E exactEventPath) %7B%0A%09%09this.exactEventPath = exactEventPath;%0A%09%7D%0A%0A
 %7D%0A

add the exactEventPath to the session. Very useful for the plugins.