package net.etalia.client.http.httpclient;

import java.lang.reflect.Type;

import net.etalia.client.http.Call;
import net.etalia.client.http.Caller;
import net.etalia.client.http.Caller.HttpMethod;

import org.apache.http.client.HttpClient;

public class HttpClientCaller<Serv> extends Caller<Serv> {

	protected HttpClient httpClient;
	protected String baseUrl;
	
	public void setHttpClient(HttpClient httpClient) {
		this.httpClient = httpClient;
	}
	
	public HttpClient getHttpClient() {
		return httpClient;
	}
	
	public void setBaseUrl(String baseUrl) {
		this.baseUrl = baseUrl;
	}
	public String getBaseUrl() {
		return baseUrl;
	}
	
	public HttpClientCaller(Class<Serv> serviceInterface) {
		super(serviceInterface);
	}

	@Override
	protected <X> Call<X> createCall(Type type, HttpMethod method, String path) {
		return new HttpClientCall<X>(this, type, method, path);
	}

	
	
}

@@ -146,57 +146,8 @@
 ler;
-%0Aimport net.etalia.client.http.Caller.HttpMethod;
 %0A%0Aim
@@ -310,16 +310,256 @@
 eUrl;%0A%09%0A
+%09public HttpClientCaller(Class%3CServ%3E serviceInterface) %7B%0A%09%09super(serviceInterface);%0A%09%7D%0A%0A%09@Override%0A%09protected %3CX%3E Call%3CX%3E createCall(Type type, HttpMethod method, String path) %7B%0A%09%09return new HttpClientCall%3CX%3E(this, type, method, path);%0A%09%7D%0A%0A
 %09public 
@@ -629,34 +629,32 @@
  httpClient;%0A%09%7D%0A
-%09%0A
 %09public HttpClie
@@ -694,26 +694,25 @@
 pClient;%0A%09%7D%0A
-%09
 %0A
+
 %09public void
@@ -825,252 +825,7 @@
 %0A%09%7D%0A
-%09%0A%09public HttpClientCaller(Class%3CServ%3E serviceInterface) %7B%0A%09%09super(serviceInterface);%0A%09%7D%0A%0A%09@Override%0A%09protected %3CX%3E Call%3CX%3E createCall(Type type, HttpMethod method, String path) %7B%0A%09%09return new HttpClientCall%3CX%3E(this, type, method, path);%0A%09%7D%0A%0A%09%0A%09
 %0A%7D%0A

Clean code