// Path: src/main/java/com/biasedbit/hotpotato/client/HttpClient.java
// public interface HttpClient {
// 
//     /**
//      * Initialise the instance.
//      * <p/>
//      * All clients must be initialised prior to their usage. Calling any of the {@code execute()} methods on a client
//      * prior to calling {@code init()} will result in a {@link CannotExecuteRequestException}.
//      *
//      * @return {@code true} if successfully initialised, {@code false} otherwise.
//      */
//     boolean init();
// 
//     /**
//      * Terminate the instance.
//      * <p/>
//      * When a client is no longer needed, it should be properly shut down by calling {@code terminate()} in order to
//      * release resources.
//      * <p/>
//      * Terminating a client while it is still processing requests will result in all requests being finished (failing),
//      * no matter if they are in the event queue, request queue or already executing inside a connection.
//      */
//     void terminate();
// 
//     /**
//      * Executes a request to a given host on port 80 with default timeout of the client.
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param request   Request to execute.
//      * @param processor Response body processor.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     <T> HttpRequestFuture<T> execute(String host, int port, HttpRequest request, HttpResponseProcessor<T> processor)
//             throws CannotExecuteRequestException;
// 
//     /**
//      * Version of {@code execute()} that allows manual definition of timeout.
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param timeout   Manual timeout for the operation to complete. This timeout is related to the request execution
//      *                  time once it enters a connection, not the full lifecycle of the request. If there are many
//      *                  events in the event queue it is likely that the request will have to wait a couple of
//      *                  milliseconds before actually entering a connection.
//      * @param request   Request to execute.
//      * @param processor Response body processor.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     <T> HttpRequestFuture<T> execute(String host, int port, int timeout, HttpRequest request,
//                                      HttpResponseProcessor<T> processor)
//             throws CannotExecuteRequestException;
// 
//     /**
//      * Version {@code execute()} that discards the result of the operation. 
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param request   Request to execute.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     HttpRequestFuture execute(String host, int port, HttpRequest request)
//             throws CannotExecuteRequestException;
// 
//     boolean isHttps();
// }


import com.biasedbit.hotpotato.client.HttpClient;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import java.util.concurrent.TimeUnit;
     *
     * @param timeoutMillis Time alloted for the wait, in milliseconds.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     *
     * @throws InterruptedException if the current thread was interrupted
     */
    boolean await(long timeoutMillis) throws InterruptedException;

    /**
     * Waits for this future to be completed within the specified time limit without interruption. This method catches
     * an {@link InterruptedException} and discards it silently.
     *
     * @param timeout Time alloted for the wait.
     * @param unit    Unit of time to wait.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     */
    boolean awaitUninterruptibly(long timeout, TimeUnit unit);

    /**
     * Waits for this future to be completed within the specified time limit without interruption.  This method catches
     * an {@link InterruptedException} and discards it silently.
     *
     * @param timeoutMillis Time alloted for the wait, in milliseconds.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     */
    boolean awaitUninterruptibly(long timeoutMillis);

// Path: src/main/java/com/biasedbit/hotpotato/client/HttpClient.java
// public interface HttpClient {
// 
//     /**
//      * Initialise the instance.
//      * <p/>
//      * All clients must be initialised prior to their usage. Calling any of the {@code execute()} methods on a client
//      * prior to calling {@code init()} will result in a {@link CannotExecuteRequestException}.
//      *
//      * @return {@code true} if successfully initialised, {@code false} otherwise.
//      */
//     boolean init();
// 
//     /**
//      * Terminate the instance.
//      * <p/>
//      * When a client is no longer needed, it should be properly shut down by calling {@code terminate()} in order to
//      * release resources.
//      * <p/>
//      * Terminating a client while it is still processing requests will result in all requests being finished (failing),
//      * no matter if they are in the event queue, request queue or already executing inside a connection.
//      */
//     void terminate();
// 
//     /**
//      * Executes a request to a given host on port 80 with default timeout of the client.
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param request   Request to execute.
//      * @param processor Response body processor.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     <T> HttpRequestFuture<T> execute(String host, int port, HttpRequest request, HttpResponseProcessor<T> processor)
//             throws CannotExecuteRequestException;
// 
//     /**
//      * Version of {@code execute()} that allows manual definition of timeout.
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param timeout   Manual timeout for the operation to complete. This timeout is related to the request execution
//      *                  time once it enters a connection, not the full lifecycle of the request. If there are many
//      *                  events in the event queue it is likely that the request will have to wait a couple of
//      *                  milliseconds before actually entering a connection.
//      * @param request   Request to execute.
//      * @param processor Response body processor.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     <T> HttpRequestFuture<T> execute(String host, int port, int timeout, HttpRequest request,
//                                      HttpResponseProcessor<T> processor)
//             throws CannotExecuteRequestException;
// 
//     /**
//      * Version {@code execute()} that discards the result of the operation. 
//      *
//      * @param host      Destination host.
//      * @param port      Destination port.
//      * @param request   Request to execute.
//      *
//      * @return Future associated with the operation.
//      *
//      * @throws CannotExecuteRequestException Thrown when the request is invalid or the client can no longer accept
//      *                                       requests, either due to termination or full queue.
//      */
//     HttpRequestFuture execute(String host, int port, HttpRequest request)
//             throws CannotExecuteRequestException;
// 
//     boolean isHttps();
// }


// Path: src/main/java/com/biasedbit/hotpotato/request/HttpRequestFuture.java
import com.biasedbit.hotpotato.client.HttpClient;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import java.util.concurrent.TimeUnit;

     *
     * @param timeoutMillis Time alloted for the wait, in milliseconds.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     *
     * @throws InterruptedException if the current thread was interrupted
     */
    boolean await(long timeoutMillis) throws InterruptedException;

    /**
     * Waits for this future to be completed within the specified time limit without interruption. This method catches
     * an {@link InterruptedException} and discards it silently.
     *
     * @param timeout Time alloted for the wait.
     * @param unit    Unit of time to wait.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     */
    boolean awaitUninterruptibly(long timeout, TimeUnit unit);

    /**
     * Waits for this future to be completed within the specified time limit without interruption.  This method catches
     * an {@link InterruptedException} and discards it silently.
     *
     * @param timeoutMillis Time alloted for the wait, in milliseconds.
     *
     * @return {@code true} if and only if the future was completed within the specified time limit
     */
    boolean awaitUninterruptibly(long timeoutMillis);

    HttpClient getClient();