public class HttpRequesterConfigBuilder extends Object
HttpRequesterConfig
created by the builder
will be initialized. The lifecycle of the created object must be managed by the client of this class.Constructor and Description |
---|
HttpRequesterConfigBuilder(MuleContext muleContext) |
public HttpRequesterConfigBuilder(MuleContext muleContext)
public HttpRequesterConfigBuilder setAuthentication(HttpAuthentication authentication)
HttpAuthentication
use
BasicAuthenticationBuilder
authentication
- authentication configuration to use for requests.public HttpRequesterConfigBuilder setTlsContext(TlsContextFactory tlsContext)
TlsContextFactory
use
TlsContextFactoryBuilder
tlsContext
- tls configuration for HTTPS connectionspublic HttpRequesterConfigBuilder setProxyConfig(ProxyConfig proxyConfig)
proxyConfig
- proxy configuration for outgoing HTTP requestpublic HttpRequesterConfigBuilder setResponseTimeout(int responseTimeout)
responseTimeout
- maximum time to wait for a responsepublic HttpRequesterConfigBuilder setMaxConnections(int maxConnections)
maxConnections
- the maximum number of outgoing connections openedpublic HttpRequesterConfigBuilder setUsePersistentConnections(boolean usePersistentConnections)
usePersistentConnections
- true to reuse a connection for several request,
false to discard a connection after the first request.public HttpRequesterConfigBuilder setConnectionIdleTimeout(int connectionIdleTimeout)
connectionIdleTimeout
- maximum time a connection will be left open while it's not being used.public HttpRequesterConfigBuilder setProtocol(HttpConstants.Protocols protocol)
protocol
- protocol to use, HTTP or HTTPS. Needs to be HTTPS to establish HTTPS connectionspublic HttpRequesterConfigBuilder setHostExpression(String host)
host
- the default host to connect to. It may be an expressionpublic HttpRequesterConfigBuilder setPortExpression(String port)
port
- the default port to connect to.public HttpRequesterConfigBuilder setPort(int port)
port
- expression that resolves to the port to connect to.public HttpRequesterConfigBuilder setResponseTimeoutExpression(String responseTimeoutExpression)
responseTimeoutExpression
- maximum time to wait for a responsepublic HttpRequesterConfigBuilder setParseResponse(boolean parseResponse)
parseResponse
- true if the requester should parse the response or
false if the response should be set plain as the payloadpublic HttpRequesterConfigBuilder setParseResponseExpression(String parseResponse)
parseResponse
- an expression that resolves to true if the requester should parse the response or
false if the response should be set plain as the payloadpublic HttpRequesterConfigBuilder setSendBodyMode(HttpSendBodyMode sendBodyMode)
sendBodyMode
- HttpSendBodyMode.ALWAYS
if not matter the HTTP method
the payload should be sent as the request body
HttpSendBodyMode.NEVER
if not matter the HTTP method
the payload never should be sent as the request body
HttpSendBodyMode.AUTO
if the payload will be sent
as the request body based on the HTTP request method.public HttpRequesterConfigBuilder setSendBodyModeExpression(String sendBodyMode)
sendBodyMode
- an expression that resolves:
HttpSendBodyMode.ALWAYS
if not matter the HTTP method
the payload should be sent as the request body
HttpSendBodyMode.NEVER
if not matter the HTTP method
the payload never should be sent as the request body
HttpSendBodyMode.AUTO
if the payload will be sent
as the request body based on the HTTP request method.public HttpRequesterConfigBuilder setRequestStreamingMode(HttpStreamingType requestStreamingMode)
requestStreamingMode
- HttpStreamingType.ALWAYS
if the request always
will be sent using Transfer-Encoding: chunked
HttpStreamingType.NEVER
if the request never
will be sent using Transfer-Encoding: chunked
HttpStreamingType.AUTO
if the request
will be sent using Transfer-Encoding: chunked based on the payload content. If the payload is an stream then
it will be sent using Transfer-Encoding: chunkedpublic HttpRequesterConfigBuilder setRequestStreamingModeExpression(String requestStreamingMode)
requestStreamingMode
- an expression that resovles to:
HttpStreamingType.ALWAYS
if the request always
will be sent using Transfer-Encoding: chunked
HttpStreamingType.NEVER
if the request never
will be sent using Transfer-Encoding: chunked
HttpStreamingType.AUTO
if the request
will be sent using Transfer-Encoding: chunked based on the payload content. If the payload is an stream then
it will be sent using Transfer-Encoding: chunkedpublic HttpRequesterConfig build() throws MuleException
HttpRequesterConfig
created with the
provided configuration.MuleException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.