/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.common.spring.rest;

import com.crunii.micro.common.utils.JsonUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.http.Header;

import java.util.Collection;
import java.util.Collections;

/**
 * @author 田平 create 2021/9/28 16:55
 */
@ToString
@Builder(toBuilder = true)
@Getter
@Setter
public class RestConfig {
	/**
	 * // 默认60秒 响应超时
	 */
	@Builder.Default
	private int socketTimeout = 60000;
	/**
	 * // 默认30秒 请求超时
	 */
	@Builder.Default
	private int requestTimeout = 30000;
	/**
	 * // 默认30秒 链接超时
	 */
	@Builder.Default
	private int connectTimeout = 30000;
	/**
	 * // 默认最大连接数 默认
	 */
	@Builder.Default
	private int maxTotal = 512;
	/**
	 * // 默认每个路由基础的连接
	 */
	@Builder.Default
	private int maxPerRoute = 64;

	@Builder.Default
	private ObjectMapper mapper = JsonUtil.getMapper();

	@Builder.Default
	private Collection<? extends Header> defaultHeaders = Collections.emptyList();

	@Builder.Default
	private boolean enabledLog = false;
	/**
	 * 是否需要公网
	 * 代理服务器地址
	 * example：192.168.149.189:8889
	 */
	@Builder.Default
	private String proxyServerAddress;
}
