/**
 * 
 */
package com.trendrr.oss.networking.cheshire;

import java.util.Map;

import com.trendrr.oss.DynMap;
import com.trendrr.oss.exceptions.TrendrrException;
import com.trendrr.oss.exceptions.TrendrrTimeoutException;


/**
 * An interface that represents a class that can make an api call either synchronously or asynchronously.
 * 
 * 
 * @author Dustin Norlander
 * @created Oct 20, 2011
 * 
 */
public interface CheshireApiCaller {

	/**
	 * Does an asynchronous api call.  This method returns immediately. the Response or error is sent to the callback.
	 * 
	 * 
	 * @param endPoint
	 * @param method
	 * @param params
	 * @param callback
	 */
	public void apiCall(String endPoint, Verb method, Map params, CheshireApiCallback callback);
	
	/**
	 * A synchronous call.  blocks until response is available.  Please note that this does *NOT* block concurrent api calls, so you can continue to 
	 * make calls in other threads.
	 * 
	 * If the maxReconnectAttempts is non-zero (-1 is infinit reconnect attempts), then this will attempt to reconnect and send on any io problems. 
	 * 
	 * @param endPoint
	 * @param method
	 * @param params
	 * @param timeoutMillis throw an exception if this # of millis passes,  < 1 should be infinite.
	 * @return
	 * @throws Exception
	 */
	public DynMap apiCall(String endPoint, Verb method, Map params, long timeoutMillis) throws TrendrrTimeoutException, TrendrrException;
	
}

@@ -1413,10 +1413,160 @@
 tion;%0A%09%0A
+%09%0A%09/**%0A%09 * gets the host address%0A%09 * @return%0A%09 */%0A%09public String getHost();%0A%09%0A%09/**%0A%09 * gets the cheshire port%0A%09 * @return%0A%09 */%0A%09public int getPort();%0A
 %7D%0A

add gethost and getport to api caller