// Path: kbox.fusca/src/main/java/org/aksw/kbox/fusca/exception/ServerStartException.java
// public class ServerStartException extends Exception {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = -8495102644748797751L;
// 
// 	public ServerStartException(String message, Exception e) {
// 		super(message, e);
// 	}
// }


import org.aksw.kbox.fusca.exception.ServerStartException;
import org.apache.jena.fuseki.main.FusekiServer;
import org.apache.jena.query.ARQ;
import org.apache.jena.query.Dataset;
import org.apache.jena.query.DatasetFactory;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.tdb.TDBFactory;
package org.aksw.kbox.fusca;


/**
 * 
 * @author @author {@linkplain http://emarx.org}
 *
 */
public class Server {
	
	private int port = 3030;
	private DatasetGraph dsg = null;
	private String subDomain = null;
	private String pagePath = null;
	private Listener listener = null;
	
	public Server(int port, String pagePath, String subDomain, long timeout, Model model, Listener listener) {
		this(port, pagePath, subDomain, model, listener);
		ARQ.getContext().set(ARQ.queryTimeout, Long.toString(timeout));
	}

	public Server(int port, String pagePath, String subDomain, Model model, Listener listener) {
		this.port = port;
		this.subDomain = subDomain;
		this.pagePath = pagePath;
		Dataset dataset = DatasetFactory.create(model);
		this.dsg = dataset.asDatasetGraph();
		this.listener = listener;
	}
	
	public Server(int port, String pagePath, String subDomain, String datasetPath) {
		this.port = port;
		this.subDomain = subDomain;
		this.pagePath = pagePath;
		this.dsg = TDBFactory.createDatasetGraph(datasetPath);
	}

// Path: kbox.fusca/src/main/java/org/aksw/kbox/fusca/exception/ServerStartException.java
// public class ServerStartException extends Exception {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = -8495102644748797751L;
// 
// 	public ServerStartException(String message, Exception e) {
// 		super(message, e);
// 	}
// }


// Path: kbox.fusca/src/main/java/org/aksw/kbox/fusca/Server.java
import org.aksw.kbox.fusca.exception.ServerStartException;
import org.apache.jena.fuseki.main.FusekiServer;
import org.apache.jena.query.ARQ;
import org.apache.jena.query.Dataset;
import org.apache.jena.query.DatasetFactory;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.tdb.TDBFactory;

package org.aksw.kbox.fusca;


/**
 * 
 * @author @author {@linkplain http://emarx.org}
 *
 */
public class Server {
	
	private int port = 3030;
	private DatasetGraph dsg = null;
	private String subDomain = null;
	private String pagePath = null;
	private Listener listener = null;
	
	public Server(int port, String pagePath, String subDomain, long timeout, Model model, Listener listener) {
		this(port, pagePath, subDomain, model, listener);
		ARQ.getContext().set(ARQ.queryTimeout, Long.toString(timeout));
	}

	public Server(int port, String pagePath, String subDomain, Model model, Listener listener) {
		this.port = port;
		this.subDomain = subDomain;
		this.pagePath = pagePath;
		Dataset dataset = DatasetFactory.create(model);
		this.dsg = dataset.asDatasetGraph();
		this.listener = listener;
	}
	
	public Server(int port, String pagePath, String subDomain, String datasetPath) {
		this.port = port;
		this.subDomain = subDomain;
		this.pagePath = pagePath;
		this.dsg = TDBFactory.createDatasetGraph(datasetPath);
	}

	public void start() throws ServerStartException {