
package com.eactive.eai.adapter.http.client;

import java.util.HashMap;

public class HttpClientAdapterVO {
	protected String url = null;
	protected String parameterName = null;
	protected String method = null;

	protected String contentType = null;

	protected String encode = null;
	protected String testCallYn = null;

	protected String adapterGroupName = null;
	protected String adapterName = null;
	protected String responseType = null;
	protected String urlEncodeYn = null;

	protected int connectionTimeout = 0;
	protected int maxTotalConnections = 50;
	protected int maxHostConnections = 10;
	protected int timeout = -1;
	protected int traceLevel = 0;

	protected long slowTranTime = 2000L;

	protected String httpVersion = null;

	// client header 값 추가
	protected HashMap<String, String> adapterHeaders = null;
	
	// mTLS
	boolean useMtls = false;
	String clientId = null;
	String keyStorePath = null;
	String keyStorePassword = null;
	String trustStorePath = null;
	String trustStorePassword = null;
	
	public int getMaxTotalConnections() {
		return maxTotalConnections;
	}

	public void setMaxTotalConnections(int maxTotalConnections) {
		this.maxTotalConnections = maxTotalConnections;
	}

	public int getMaxHostConnections() {
		return maxHostConnections;
	}

	public void setMaxHostConnections(int maxHostConnections) {
		this.maxHostConnections = maxHostConnections;
	}

	public String getHttpVersion() {
		return httpVersion;
	}

	public void setHttpVersion(String httpVersion) {
		this.httpVersion = httpVersion;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getParameterName() {
		return parameterName;
	}

	public void setParameterName(String parameterName) {
		this.parameterName = parameterName;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getContentType() {
		return contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public String getEncode() {
		return encode;
	}

	public void setEncode(String encode) {
		this.encode = encode;
	}

	public String getTestCallYn() {
		return testCallYn;
	}

	public void setTestCallYn(String testCallYn) {
		this.testCallYn = testCallYn;
	}

	public String getAdapterGroupName() {
		return adapterGroupName;
	}

	public void setAdapterGroupName(String adapterGroupName) {
		this.adapterGroupName = adapterGroupName;
	}

	public String getAdapterName() {
		return adapterName;
	}

	public void setAdapterName(String adapterName) {
		this.adapterName = adapterName;
	}

	public String getResponseType() {
		return responseType;
	}

	public void setResponseType(String responseType) {
		this.responseType = responseType;
	}

	public String getUrlEncodeYn() {
		return urlEncodeYn;
	}

	public void setUrlEncodeYn(String urlEncodeYn) {
		this.urlEncodeYn = urlEncodeYn;
	}

	public int getConnectionTimeout() {
		return connectionTimeout;
	}

	public void setConnectionTimeout(int connectionTimeout) {
		this.connectionTimeout = connectionTimeout;
	}

	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}

	public int getTraceLevel() {
		return traceLevel;
	}

	public void setTraceLevel(int traceLevel) {
		this.traceLevel = traceLevel;
	}

	public long getSlowTranTime() {
		return slowTranTime;
	}

	public void setSlowTranTime(long slowTranTime) {
		this.slowTranTime = slowTranTime;
	}

	public HashMap<String, String> getAdapterHeaders() {
		return adapterHeaders;
	}

	public void setAdapterHeaders(HashMap<String, String> adapterHeaders) {
		this.adapterHeaders = adapterHeaders;
	}
	
	
	public boolean isUseMtls() {
		return useMtls;
	}
	
	public void setUseMtls(boolean useMtls) {
		this.useMtls = useMtls;
	}
	
	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public String getKeyStorePath() {
		return keyStorePath;
	}

	public void setKeyStorePath(String keyStorePath) {
		this.keyStorePath = keyStorePath;
	}

	public String getKeyStorePassword() {
		return keyStorePassword;
	}

	public void setKeyStorePassword(String keyStorePassword) {
		this.keyStorePassword = keyStorePassword;
	}

	public String getTrustStorePath() {
		return trustStorePath;
	}

	public void setTrustStorePath(String trustStorePath) {
		this.trustStorePath = trustStorePath;
	}

	public String getTrustStorePassword() {
		return trustStorePassword;
	}

	public void setTrustStorePassword(String trustStorePassword) {
		this.trustStorePassword = trustStorePassword;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("HttpClientAdapterVO [adapterGroupName=" + adapterGroupName + ", adapterGroupName=" + adapterGroupName + ", responseType=" + responseType );
		sb.append("\n");
		sb.append("url=" + url + ", parameterName=" + parameterName + ", method=" + method );
		sb.append("\n");
		sb.append(", contentType=" + contentType + ", encode=" + encode + ", testCallYn=" + testCallYn );
		sb.append("\n");
		sb.append(", urlEncodeYn=" + urlEncodeYn + ", connectionTimeout=" + connectionTimeout );
		sb.append("\n");
		sb.append(", maxTotalConnections=" + maxTotalConnections + ", maxHostConnections=" + maxHostConnections );
		sb.append("\n");
		sb.append(", timeout=" + timeout + ", traceLevel=" + traceLevel + ", slowTranTime=" + slowTranTime );
		sb.append("\n");
		sb.append(", httpVersion=" + httpVersion + "]" );
		if(adapterHeaders != null) {
			sb.append("\nadapter header [\n");
			for (String key : adapterHeaders.keySet()) {
				sb.append(key).append("=").append(adapterHeaders.get(key));
				sb.append("\n");
			}
			sb.append("\n]");
		}
		sb.append("\n");
		sb.append(", useMtls=" + useMtls + ", clientId=" + clientId);
		sb.append(", keyStorePath=" + keyStorePath + ", keyStorePassword=" + keyStorePassword );
		sb.append(", trustStorePath=" + trustStorePath + ", trustStorePassword=" + trustStorePassword );
		return sb.toString();
		
	}
	
	
}
