package org.torproject.jtor;

import org.torproject.jtor.circuits.CircuitManager;
import org.torproject.jtor.circuits.impl.CircuitManagerImpl;
import org.torproject.jtor.circuits.impl.TorInitializationTracker;
import org.torproject.jtor.config.impl.TorConfigImpl;
import org.torproject.jtor.connections.ConnectionCache;
import org.torproject.jtor.directory.Directory;
import org.torproject.jtor.directory.downloader.DirectoryDownloader;
import org.torproject.jtor.directory.impl.DirectoryImpl;
import org.torproject.jtor.socks.SocksPortListener;
import org.torproject.jtor.socks.impl.SocksPortListenerImpl;

/**
 * The <code>Tor</code> class is a collection of static methods for instantiating
 * various subsystem modules.
 */
public class Tor {
	
	public static int BOOTSTRAP_STATUS_STARTING = 0;
	public static int BOOTSTRAP_STATUS_CONN_DIR = 5;
	public static int BOOTSTRAP_STATUS_HANDSHAKE_DIR = 10;
	public static int BOOTSTRAP_STATUS_ONEHOP_CREATE = 15;
	public static int BOOTSTRAP_STATUS_REQUESTING_STATUS = 20;
	public static int BOOTSTRAP_STATUS_LOADING_STATUS = 25;
	public static int BOOTSTRAP_STATUS_REQUESTING_KEYS = 35;
	public static int BOOTSTRAP_STATUS_LOADING_KEYS = 40;
	public static int BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS = 45;
	public static int BOOTSTRAP_STATUS_LOADING_DESCRIPTORS = 50;
	public static int BOOTSTRAP_STATUS_CONN_OR = 80;
	public static int BOOTSTRAP_STATUS_HANDSHAKE_OR = 85;
	public static int BOOTSTRAP_STATUS_CIRCUIT_CREATE = 90;
	public static int BOOTSTRAP_STATUS_DONE = 100;
	
	
	private final static String implementation = "JTor";
	private final static String version = "0.0.0";
	
	
	public static String getImplementation() {
		return implementation;
	}
	/**
	 * Return a string describing the version of this software.
	 * 
	 * @return A string representation of the software version.
	 */
	public static String getVersion() {
		return version;
	}
	
	/**
	 * Create and return a new <code>TorConfig</code> instance.
	 * 
	 * @param logManager This is a required dependency.  You must create a <code>LogManager</code>
	 *                   before calling this method to create a <code>TorConfig</code>
	 * @return A new <code>TorConfig</code> instance.
	 * @see TorConfig
	 */
	static public TorConfig createConfig() {
		return new TorConfigImpl();
	}

	static public TorInitializationTracker createInitalizationTracker() {
		return new TorInitializationTracker();
	}

	/**
	 * Create and return a new <code>Directory</code> instance.
	 * 
	 * @param logManager This is a required dependency.  You must create a <code>LogManager</code> 
	 *                   before creating a <code>Directory</code>. 
	 * @param config This is a required dependency. You must create a <code>TorConfig</code> before
	 *               calling this method to create a <code>Directory</code>
	 * @return A new <code>Directory</code> instance.
	 * @see Directory
	 */
	static public Directory createDirectory(TorConfig config) {
		return new DirectoryImpl(config);
	}

	static public ConnectionCache createConnectionCache(TorInitializationTracker tracker) {
		return new ConnectionCache(tracker);
	}
	/**
	 * Create and return a new <code>CircuitManager</code> instance.
	 * 
	 * @return A new <code>CircuitManager</code> instance.
	 * @see CircuitManager
	 */
	static public CircuitManager createCircuitManager(Directory directory, ConnectionCache connectionCache, TorInitializationTracker tracker) {
		return new CircuitManagerImpl(directory, connectionCache, tracker);
	}

	/**
	 * Create and return a new <code>SocksPortListener</code> instance.
	 * 
	 * @param logManager This is a required dependency.  You must create a <code>LogManager</code>
	 *                   before calling this method to create a <code>SocksPortListener</code>.
	 * @param circuitManager This is a required dependency.  You must create a <code>CircuitManager</code>
	 *                       before calling this method to create a <code>SocksPortListener</code>.
	 * @return A new <code>SocksPortListener</code> instance.
	 * @see SocksPortListener
	 */
	static public SocksPortListener createSocksPortListener(CircuitManager circuitManager) {
		return new SocksPortListenerImpl(circuitManager);
	}

	/**
	 * Create and return a new <code>DirectoryDownloader</code> instance.
	 *
	 * @param logManager This is a required dependency.  You must create a <code>LogManager</code>
	 *                   before calling this method to create a <code>DirectoryDownloader</code>.

	 * @param directory This is a required dependency.  You must create a <code>Directory</code>
	 *                  before calling this method to create a <code>DirectoryDownloader</code>
	 *                  
	 * @param circuitManager This is a required dependency.  You must create a <code>CircuitManager</code>
	 *                       before calling this method to create a <code>DirectoryDownloader</code>.
	 *                       
	 * @return A new <code>DirectoryDownloader</code> instance.
	 * @see DirectoryDownloader
	 */
	static public DirectoryDownloader createDirectoryDownloader(Directory directory, CircuitManager circuitManager) {
		return new DirectoryDownloader(directory, circuitManager);
	}
}

@@ -742,32 +742,38 @@
 Tor %7B%0A%09%0A%09public 
+final 
 static int BOOTS
@@ -798,32 +798,38 @@
 NG = 0;%0A%09public 
+final 
 static int BOOTS
@@ -854,32 +854,38 @@
 IR = 5;%0A%09public 
+final 
 static int BOOTS
@@ -916,32 +916,38 @@
 R = 10;%0A%09public 
+final 
 static int BOOTS
@@ -978,32 +978,38 @@
 E = 15;%0A%09public 
+final 
 static int BOOTS
@@ -1044,32 +1044,38 @@
 S = 20;%0A%09public 
+final 
 static int BOOTS
@@ -1107,32 +1107,38 @@
 S = 25;%0A%09public 
+final 
 static int BOOTS
@@ -1171,32 +1171,38 @@
 S = 35;%0A%09public 
+final 
 static int BOOTS
@@ -1232,32 +1232,38 @@
 S = 40;%0A%09public 
+final 
 static int BOOTS
@@ -1303,32 +1303,38 @@
 S = 45;%0A%09public 
+final 
 static int BOOTS
@@ -1371,32 +1371,38 @@
 S = 50;%0A%09public 
+final 
 static int BOOTS
@@ -1427,32 +1427,38 @@
 R = 80;%0A%09public 
+final 
 static int BOOTS
@@ -1488,32 +1488,38 @@
 R = 85;%0A%09public 
+final 
 static int BOOTS
@@ -1555,24 +1555,30 @@
 90;%0A%09public 
+final 
 static int B

Constants should be 'final'