public class ForestConfiguration extends Object implements Serializable
public static ForestConfiguration getDefaultConfiguration()
public static ForestConfiguration configuration()
public Map<Class,Object> getInstanceCache()
public ForestConfiguration setBackend(HttpBackend backend)
backend
- HTTP后端对象public ForestConfiguration setBackendName(String backendName)
backendName
- HTTP后端名称public String getBackendName()
public HttpBackend getBackend()
public InterceptorFactory getInterceptorFactory()
public void setInterceptorFactory(InterceptorFactory interceptorFactory)
interceptorFactory
- 拦截器工厂public ForestConfiguration setHttpBackendSelector(HttpBackendSelector httpBackendSelector)
httpBackendSelector
- HTTP后端选择器public String getId()
public Integer getMaxConnections()
public ForestConfiguration setMaxConnections(Integer maxConnections)
maxConnections
- 全局的最大连接数public Integer getMaxRouteConnections()
public ForestConfiguration setMaxRouteConnections(Integer maxRouteConnections)
maxRouteConnections
- 最大请求路径连接数public Integer getTimeout()
public ForestConfiguration setTimeout(Integer timeout)
timeout
- 请求超时时间,单位为毫秒public String getCharset()
public void setCharset(String charset)
charset
- 字符集名称public Integer getConnectTimeout()
public ForestConfiguration setConnectTimeout(Integer connectTimeout)
connectTimeout
- 连接超时时间,单位为毫秒public Class getRetryer()
public void setRetryer(Class retryer)
retryer
- 重试策略类public Integer getRetryCount()
public ForestConfiguration setRetryCount(Integer retryCount)
retryCount
- 重试次数public long getMaxRetryInterval()
public void setMaxRetryInterval(long maxRetryInterval)
maxRetryInterval
- 最大请求重试之间的时间间隔public String getSslProtocol()
public void setSslProtocol(String sslProtocol)
sslProtocol
- SSL协议名称public boolean isLogEnabled()
true
, 否则为 false
public void setLogEnabled(boolean logEnabled)
logEnabled
- 允许为 true
, 否则为 false
public boolean isLogRequest()
true
, 否则为 false
public void setLogRequest(boolean logRequest)
logRequest
- 允许为 true
, 否则为 false
public boolean isLogResponseStatus()
true
, 否则为 false
public void setLogResponseStatus(boolean logResponseStatus)
logResponseStatus
- 允许为 true
, 否则为 false
public boolean isLogResponseContent()
true
, 否则为 false
public void setLogResponseContent(boolean logResponseContent)
logResponseContent
- 允许为 true
, 否则为 false
public ForestLogHandler getLogHandler()
public void setLogHandler(ForestLogHandler logHandler)
logHandler
- 日志处理器接口实例public boolean isCacheEnabled()
true
, 否则为 false
public void setCacheEnabled(boolean cacheEnabled)
cacheEnabled
- 如果允许缓存实例为 true
, 否则为 false
public List<RequestNameValue> getDefaultParameters()
RequestNameValue
对象列表public ForestConfiguration setDefaultParameters(List<RequestNameValue> defaultParameters)
defaultParameters
- 请求参数列表public List<RequestNameValue> getDefaultHeaders()
RequestNameValue
对象列表public ForestConfiguration setDefaultHeaders(List<RequestNameValue> defaultHeaders)
defaultHeaders
- 请求头信息列表public void setInterceptors(List<Class> interceptors)
interceptors
- 全局拦截器列表public ForestConfiguration setJsonConverter(ForestJsonConverter converter)
converter
- JSON数据转换器public ForestJsonConverter getJsonConverter()
public ForestConfiguration setXmlConverter(ForestXmlConverter converter)
converter
- XML数据转换器public ForestXmlConverter getXmlConverter()
public <T> ProxyFactory<T> getProxyFactory(Class<T> clazz)
T
- 请求接口类泛型clazz
- 请求接口类public ForestConfiguration setVariableValue(String name, Object value)
name
- 变量名value
- 变量值public Object getVariableValue(String name)
name
- 变量名public Map<String,SSLKeyStore> getSslKeyStores()
public ForestConfiguration setSslKeyStores(Map<String,SSLKeyStore> sslKeyStores)
sslKeyStores
- SSL的Key Store表public ForestConfiguration registerKeyStore(SSLKeyStore keyStore)
keyStore
- Key Store信息public SSLKeyStore getKeyStore(String id)
id
- Key Store的IDSSLKeyStore
实例public ForestConverter getConverter(ForestDataType dataType)
dataType
- 请求响应数据类型public Map<ForestDataType,ForestConverter> getConverterMap()
public ForestConfiguration setConverterMap(Map<ForestDataType,ForestConverter> converterMap)
converterMap
- 数据转换器表public ForestConfiguration setVariables(Map<String,Object> variables)
variables
- 变量表public <T> T createInstance(Class<T> clazz)
T
- 请求接口类泛型clazz
- 请求接口类public ForestConfiguration registerFilter(String name, Class filterClass)
name
- 过滤器名称filterClass
- 过滤器类public List<String> getRegisteredFilterNames()
public boolean hasFilter(String name)
name
- 过滤器名称true
, 否则为 false
Copyright © 2020. All rights reserved.