// Path: src/main/com/quickserverlab/quickcached/cache/CacheException.java
// public class CacheException extends Exception {
// 	public CacheException() {
// 		super();
// 	}
// 	
// 	public CacheException(String msg) {
// 		super(msg);
// 	}
// }
// 
// Path: src/main/com/quickserverlab/quickcached/cache/CacheInterface.java
// public interface CacheInterface {
// 	
// 	public String getName();
// 	
// 	public void set(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize) throws CacheException;	
// 	
// 	public boolean touch(String key, int expInSec) throws CacheException;	
// 	
// 	public Object get(String key, boolean incrementCount) throws CacheException;
// 	public Object get(String key) throws CacheException;		
// 	public boolean delete(String key) throws CacheException;	
// 
// 	public void flush() throws CacheException;
// 
// 	/**
// 	 *
// 	 * @return Map with key as curr_items, total_items, cmd_get, cmd_set,
// 	 *  get_hits, get_misses, delete_misses, delete_hits, evictions, expired
// 	 */
// 	public void saveStats(Map map);
// 	
// 	public boolean saveToDisk();
// 	
// 	public boolean readFromDisk();
// }


import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.cache.CacheException;
import com.quickserverlab.quickcached.cache.CacheInterface;
import org.quickserver.net.server.ClientHandler;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
		} 

		if (command.startsWith("get ") || command.startsWith("gets ")) {
			handleGetCommands(handler, command);			
		} else if (command.equals("version")) {
			sendResponse(handler, versionOutput);
		} else if (command.startsWith("set ") || command.startsWith("add ")
				|| command.startsWith("replace ") || command.startsWith("append ")
				|| command.startsWith("prepend ") || command.startsWith("cas ")) {
			
			handleStorageCommands(handler, command);
			Data data = (Data) handler.getClientData();
			if (data.isAllDataIn()) {
				processStorageCommands(handler);
				return;
			} else {
				return;
			}			
		} else if (command.startsWith("delete ")) {
			handleDeleteCommands(handler, command);
		} else if (command.startsWith("flush_all")) {
			handleFlushAll(handler, command);			
		} else if (command.equals("stats")) {
			Map stats = CommandHandler.getStats(handler.getServer());
			Set keySet = stats.keySet();
			Iterator iterator = keySet.iterator();
			String key = null;
			String value = null;
			while (iterator.hasNext()) {
				key = (String) iterator.next();
// Path: src/main/com/quickserverlab/quickcached/cache/CacheException.java
// public class CacheException extends Exception {
// 	public CacheException() {
// 		super();
// 	}
// 	
// 	public CacheException(String msg) {
// 		super(msg);
// 	}
// }
// 
// Path: src/main/com/quickserverlab/quickcached/cache/CacheInterface.java
// public interface CacheInterface {
// 	
// 	public String getName();
// 	
// 	public void set(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize, int expInSec) throws CacheException;
// 	public void update(String key, Object value, int objectSize) throws CacheException;	
// 	
// 	public boolean touch(String key, int expInSec) throws CacheException;	
// 	
// 	public Object get(String key, boolean incrementCount) throws CacheException;
// 	public Object get(String key) throws CacheException;		
// 	public boolean delete(String key) throws CacheException;	
// 
// 	public void flush() throws CacheException;
// 
// 	/**
// 	 *
// 	 * @return Map with key as curr_items, total_items, cmd_get, cmd_set,
// 	 *  get_hits, get_misses, delete_misses, delete_hits, evictions, expired
// 	 */
// 	public void saveStats(Map map);
// 	
// 	public boolean saveToDisk();
// 	
// 	public boolean readFromDisk();
// }


// Path: src/main/com/quickserverlab/quickcached/TextCommandProcessor.java
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.cache.CacheException;
import com.quickserverlab.quickcached.cache.CacheInterface;
import org.quickserver.net.server.ClientHandler;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

		} 

		if (command.startsWith("get ") || command.startsWith("gets ")) {
			handleGetCommands(handler, command);			
		} else if (command.equals("version")) {
			sendResponse(handler, versionOutput);
		} else if (command.startsWith("set ") || command.startsWith("add ")
				|| command.startsWith("replace ") || command.startsWith("append ")
				|| command.startsWith("prepend ") || command.startsWith("cas ")) {
			
			handleStorageCommands(handler, command);
			Data data = (Data) handler.getClientData();
			if (data.isAllDataIn()) {
				processStorageCommands(handler);
				return;
			} else {
				return;
			}			
		} else if (command.startsWith("delete ")) {
			handleDeleteCommands(handler, command);
		} else if (command.startsWith("flush_all")) {
			handleFlushAll(handler, command);			
		} else if (command.equals("stats")) {
			Map stats = CommandHandler.getStats(handler.getServer());
			Set keySet = stats.keySet();
			Iterator iterator = keySet.iterator();
			String key = null;
			String value = null;
			while (iterator.hasNext()) {
				key = (String) iterator.next();
				value = (String) stats.get(key);