@Metadata(label="verifiers",
enums="parameters,connectivity")
@Component(value="http,https")
public class HttpComponent
extends org.apache.camel.http.common.HttpCommonComponent
implements org.apache.camel.spi.RestProducerFactory, org.apache.camel.SSLContextParametersAware
Modifier and Type | Field and Description |
---|---|
protected boolean |
authCachingDisabled |
protected boolean |
automaticRetriesDisabled |
protected org.apache.http.conn.HttpClientConnectionManager |
clientConnectionManager |
protected int |
connectionRequestTimeout |
protected int |
connectionsPerRoute |
protected boolean |
connectionStateDisabled |
protected long |
connectionTimeToLive |
protected int |
connectTimeout |
protected boolean |
contentCompressionDisabled |
protected boolean |
cookieManagementDisabled |
protected org.apache.http.client.CookieStore |
cookieStore |
protected boolean |
copyHeaders |
protected boolean |
defaultUserAgentDisabled |
protected HttpClientConfigurer |
httpClientConfigurer |
protected org.apache.http.protocol.HttpContext |
httpContext |
protected int |
maxTotalConnections |
protected String |
proxyAuthDomain |
protected String |
proxyAuthHost |
protected String |
proxyAuthMethod |
protected String |
proxyAuthNtHost |
protected String |
proxyAuthPassword |
protected Integer |
proxyAuthPort |
protected String |
proxyAuthScheme |
protected String |
proxyAuthUsername |
protected boolean |
redirectHandlingDisabled |
protected int |
responsePayloadStreamingThreshold |
protected boolean |
skipRequestHeaders |
protected boolean |
skipResponseHeaders |
protected int |
socketTimeout |
protected org.apache.camel.support.jsse.SSLContextParameters |
sslContextParameters |
protected boolean |
useGlobalSslContextParameters |
protected String |
userAgent |
protected HostnameVerifier |
x509HostnameVerifier |
Constructor and Description |
---|
HttpComponent() |
HttpComponent(Class<? extends HttpEndpoint> endpointClass) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.http.conn.HttpClientConnectionManager |
createConnectionManager(Map<String,Object> parameters,
org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) |
protected org.apache.http.conn.HttpClientConnectionManager |
createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry) |
protected org.apache.http.conn.HttpClientConnectionManager |
createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry,
int maxTotalConnections,
int connectionsPerRoute) |
protected org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> |
createConnectionRegistry(HostnameVerifier x509HostnameVerifier,
org.apache.camel.support.jsse.SSLContextParameters sslContextParams,
boolean useSystemProperties) |
protected org.apache.camel.Endpoint |
createEndpoint(String uri,
String remaining,
Map<String,Object> parameters) |
protected org.apache.http.impl.client.HttpClientBuilder |
createHttpClientBuilder(String uri,
Map<String,Object> parameters,
Map<String,Object> httpClientOptions) |
protected HttpClientConfigurer |
createHttpClientConfigurer(Map<String,Object> parameters,
boolean secure)
Creates the HttpClientConfigurer based on the given parameters
|
org.apache.camel.Producer |
createProducer(org.apache.camel.CamelContext camelContext,
String host,
String verb,
String basePath,
String uriTemplate,
String queryParameters,
String consumes,
String produces,
org.apache.camel.spi.RestConfiguration configuration,
Map<String,Object> parameters) |
void |
doStart() |
void |
doStop() |
org.apache.http.conn.HttpClientConnectionManager |
getClientConnectionManager() |
int |
getConnectionRequestTimeout() |
int |
getConnectionsPerRoute() |
long |
getConnectionTimeToLive() |
int |
getConnectTimeout() |
org.apache.http.client.CookieStore |
getCookieStore() |
HttpClientConfigurer |
getHttpClientConfigurer() |
org.apache.http.protocol.HttpContext |
getHttpContext() |
int |
getMaxTotalConnections() |
String |
getProxyAuthDomain() |
String |
getProxyAuthHost() |
String |
getProxyAuthMethod() |
String |
getProxyAuthNtHost() |
String |
getProxyAuthPassword() |
Integer |
getProxyAuthPort() |
String |
getProxyAuthScheme() |
String |
getProxyAuthUsername() |
int |
getResponsePayloadStreamingThreshold() |
int |
getSocketTimeout() |
org.apache.camel.support.jsse.SSLContextParameters |
getSslContextParameters() |
String |
getUserAgent() |
org.apache.camel.component.extension.ComponentVerifierExtension |
getVerifier() |
HostnameVerifier |
getX509HostnameVerifier() |
boolean |
isAuthCachingDisabled() |
boolean |
isAutomaticRetriesDisabled() |
boolean |
isConnectionStateDisabled() |
boolean |
isContentCompressionDisabled() |
boolean |
isCookieManagementDisabled() |
boolean |
isCopyHeaders() |
boolean |
isDefaultUserAgentDisabled() |
boolean |
isRedirectHandlingDisabled() |
boolean |
isSkipRequestHeaders() |
boolean |
isSkipResponseHeaders() |
boolean |
isUseGlobalSslContextParameters() |
void |
setAuthCachingDisabled(boolean authCachingDisabled) |
void |
setAutomaticRetriesDisabled(boolean automaticRetriesDisabled) |
void |
setClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager clientConnectionManager)
To use a custom and shared HttpClientConnectionManager to manage connections.
|
void |
setConnectionRequestTimeout(int connectionRequestTimeout)
The timeout in milliseconds used when requesting a connection from the connection manager.
|
void |
setConnectionsPerRoute(int connectionsPerRoute)
The maximum number of connections per route.
|
void |
setConnectionStateDisabled(boolean connectionStateDisabled) |
void |
setConnectionTimeToLive(long connectionTimeToLive)
The time for connection to live, the time unit is millisecond, the default value is always keep alive.
|
void |
setConnectTimeout(int connectTimeout)
Determines the timeout in milliseconds until a connection is established.
|
void |
setContentCompressionDisabled(boolean contentCompressionDisabled) |
void |
setCookieManagementDisabled(boolean cookieManagementDisabled) |
void |
setCookieStore(org.apache.http.client.CookieStore cookieStore)
To use a custom org.apache.http.client.CookieStore.
|
void |
setCopyHeaders(boolean copyHeaders) |
void |
setDefaultUserAgentDisabled(boolean defaultUserAgentDisabled) |
void |
setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used.
|
void |
setHttpContext(org.apache.http.protocol.HttpContext httpContext)
To use a custom org.apache.http.protocol.HttpContext when executing requests.
|
void |
setMaxTotalConnections(int maxTotalConnections)
The maximum number of connections.
|
void |
setProxyAuthDomain(String proxyAuthDomain) |
void |
setProxyAuthHost(String proxyAuthHost) |
void |
setProxyAuthMethod(String proxyAuthMethod) |
void |
setProxyAuthNtHost(String proxyAuthNtHost) |
void |
setProxyAuthPassword(String proxyAuthPassword) |
void |
setProxyAuthPort(Integer proxyAuthPort) |
void |
setProxyAuthScheme(String proxyAuthScheme) |
void |
setProxyAuthUsername(String proxyAuthUsername) |
void |
setRedirectHandlingDisabled(boolean redirectHandlingDisabled) |
void |
setResponsePayloadStreamingThreshold(int responsePayloadStreamingThreshold) |
void |
setSkipRequestHeaders(boolean skipRequestHeaders) |
void |
setSkipResponseHeaders(boolean skipResponseHeaders) |
void |
setSocketTimeout(int socketTimeout)
Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put
differently, a maximum period inactivity between two consecutive data packets).
|
void |
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
To configure security using SSLContextParameters.
|
void |
setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.
|
void |
setUserAgent(String userAgent) |
void |
setX509HostnameVerifier(HostnameVerifier x509HostnameVerifier)
To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier.
|
protected boolean |
useIntrospectionOnEndpoint() |
canConnect, connect, disconnect, getHttpBinding, getHttpConfiguration, getParameter, getParameter, isAllowJavaSerializedObject, isMuteException, setAllowJavaSerializedObject, setHttpBinding, setHttpConfiguration, setMuteException
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useRawUri, validateParameters, validateURI
build, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
retrieveGlobalSslContextParameters
getCamelContext, setCamelContext, trySetCamelContext
@Metadata(label="advanced", description="To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used.") protected HttpClientConfigurer httpClientConfigurer
@Metadata(label="advanced", description="To use a custom and shared HttpClientConnectionManager to manage connections. If this has been configured then this is always used for all endpoints created by this component.") protected org.apache.http.conn.HttpClientConnectionManager clientConnectionManager
@Metadata(label="advanced", description="To use a custom org.apache.http.protocol.HttpContext when executing requests.") protected org.apache.http.protocol.HttpContext httpContext
@Metadata(label="security", description="To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.support.jsse.SSLContextParameters is supported per HttpComponent. If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need.") protected org.apache.camel.support.jsse.SSLContextParameters sslContextParameters
@Metadata(label="security", description="To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier.") protected HostnameVerifier x509HostnameVerifier
@Metadata(label="producer", description="To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn\'t be stored as we are just bridging (eg acting as a proxy).") protected org.apache.http.client.CookieStore cookieStore
@Metadata(label="timeout", defaultValue="-1", description="The timeout in milliseconds used when requesting a connection from the connection manager. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).") protected int connectionRequestTimeout
@Metadata(label="timeout", defaultValue="-1", description="Determines the timeout in milliseconds until a connection is established. A timeout value of zero is interpreted as an infinite timeout. A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).") protected int connectTimeout
@Metadata(label="timeout", defaultValue="-1", description="Defines the socket timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).") protected int socketTimeout
protected String proxyAuthScheme
@Metadata(label="producer,proxy", enums="Basic,Digest,NTLM", description="Proxy authentication method to use") protected String proxyAuthMethod
@Metadata(label="producer,proxy", secret=true, description="Proxy authentication username") protected String proxyAuthUsername
@Metadata(label="producer,proxy", secret=true, description="Proxy authentication password") protected String proxyAuthPassword
@Metadata(label="producer,proxy", description="Proxy authentication host") protected String proxyAuthHost
@Metadata(label="producer,proxy", description="Proxy authentication port") protected Integer proxyAuthPort
@Metadata(label="producer,proxy", description="Proxy authentication domain to use") protected String proxyAuthDomain
@Metadata(label="producer,proxy", description="Proxy authentication domain (workstation name) to use with NTML") protected String proxyAuthNtHost
@Metadata(label="advanced", defaultValue="200", description="The maximum number of connections.") protected int maxTotalConnections
@Metadata(label="advanced", defaultValue="20", description="The maximum number of connections per route.") protected int connectionsPerRoute
@Metadata(label="advanced", description="The time for connection to live, the time unit is millisecond, the default value is always keep alive.") protected long connectionTimeToLive
@Metadata(label="security", defaultValue="false", description="Enable usage of global SSL context parameters.") protected boolean useGlobalSslContextParameters
@Metadata(label="producer", defaultValue="8192", description="This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode.") protected int responsePayloadStreamingThreshold
@Metadata(label="advanced", description="Disables automatic redirect handling") protected boolean redirectHandlingDisabled
@Metadata(label="advanced", description="Disables automatic request recovery and re-execution") protected boolean automaticRetriesDisabled
@Metadata(label="advanced", description="Disables automatic content decompression") protected boolean contentCompressionDisabled
@Metadata(label="advanced", description="Disables state (cookie) management") protected boolean cookieManagementDisabled
@Metadata(label="advanced", description="Disables authentication scheme caching") protected boolean authCachingDisabled
@Metadata(label="advanced", description="Disables connection state tracking") protected boolean connectionStateDisabled
@Metadata(label="advanced", description="Disables the default user agent set by this builder if none has been provided by the user") protected boolean defaultUserAgentDisabled
@Metadata(label="producer", defaultValue="true", description="If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers).") protected boolean copyHeaders
@Metadata(label="producer,advanced", description="Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector.") protected boolean skipRequestHeaders
@Metadata(label="producer,advanced", description="Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector.") protected boolean skipResponseHeaders
@UriParam(label="producer,advanced", description="To set a custom HTTP User-Agent request header") protected String userAgent
public HttpComponent()
public HttpComponent(Class<? extends HttpEndpoint> endpointClass)
protected HttpClientConfigurer createHttpClientConfigurer(Map<String,Object> parameters, boolean secure) throws Exception
parameters
- the map of parameterssecure
- whether the endpoint is secure (eg https)Exception
- is thrown if error creating configurerprotected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
createEndpoint
in class org.apache.camel.support.DefaultComponent
Exception
protected org.apache.http.conn.HttpClientConnectionManager createConnectionManager(Map<String,Object> parameters, org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
protected org.apache.http.impl.client.HttpClientBuilder createHttpClientBuilder(String uri, Map<String,Object> parameters, Map<String,Object> httpClientOptions)
protected org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> createConnectionRegistry(HostnameVerifier x509HostnameVerifier, org.apache.camel.support.jsse.SSLContextParameters sslContextParams, boolean useSystemProperties) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
protected org.apache.http.conn.HttpClientConnectionManager createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry)
protected org.apache.http.conn.HttpClientConnectionManager createConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> registry, int maxTotalConnections, int connectionsPerRoute)
protected boolean useIntrospectionOnEndpoint()
useIntrospectionOnEndpoint
in class org.apache.camel.http.common.HttpCommonComponent
public org.apache.camel.Producer createProducer(org.apache.camel.CamelContext camelContext, String host, String verb, String basePath, String uriTemplate, String queryParameters, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,Object> parameters) throws Exception
createProducer
in interface org.apache.camel.spi.RestProducerFactory
Exception
public HttpClientConfigurer getHttpClientConfigurer()
public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
public org.apache.http.conn.HttpClientConnectionManager getClientConnectionManager()
public void setClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager clientConnectionManager)
public org.apache.http.protocol.HttpContext getHttpContext()
public void setHttpContext(org.apache.http.protocol.HttpContext httpContext)
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
public boolean isUseGlobalSslContextParameters()
isUseGlobalSslContextParameters
in interface org.apache.camel.SSLContextParametersAware
public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
setUseGlobalSslContextParameters
in interface org.apache.camel.SSLContextParametersAware
public HostnameVerifier getX509HostnameVerifier()
public void setX509HostnameVerifier(HostnameVerifier x509HostnameVerifier)
public int getMaxTotalConnections()
public void setMaxTotalConnections(int maxTotalConnections)
public int getConnectionsPerRoute()
public void setConnectionsPerRoute(int connectionsPerRoute)
public long getConnectionTimeToLive()
public void setConnectionTimeToLive(long connectionTimeToLive)
public org.apache.http.client.CookieStore getCookieStore()
public void setCookieStore(org.apache.http.client.CookieStore cookieStore)
public int getConnectionRequestTimeout()
public void setConnectionRequestTimeout(int connectionRequestTimeout)
A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).
Default: -1
public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).
Default: -1
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).
Default: -1
public String getProxyAuthScheme()
public void setProxyAuthScheme(String proxyAuthScheme)
public String getProxyAuthMethod()
public void setProxyAuthMethod(String proxyAuthMethod)
public String getProxyAuthUsername()
public void setProxyAuthUsername(String proxyAuthUsername)
public String getProxyAuthPassword()
public void setProxyAuthPassword(String proxyAuthPassword)
public String getProxyAuthHost()
public void setProxyAuthHost(String proxyAuthHost)
public Integer getProxyAuthPort()
public void setProxyAuthPort(Integer proxyAuthPort)
public String getProxyAuthDomain()
public void setProxyAuthDomain(String proxyAuthDomain)
public String getProxyAuthNtHost()
public void setProxyAuthNtHost(String proxyAuthNtHost)
public int getResponsePayloadStreamingThreshold()
public void setResponsePayloadStreamingThreshold(int responsePayloadStreamingThreshold)
public boolean isRedirectHandlingDisabled()
public void setRedirectHandlingDisabled(boolean redirectHandlingDisabled)
public boolean isAutomaticRetriesDisabled()
public void setAutomaticRetriesDisabled(boolean automaticRetriesDisabled)
public boolean isContentCompressionDisabled()
public void setContentCompressionDisabled(boolean contentCompressionDisabled)
public boolean isCookieManagementDisabled()
public void setCookieManagementDisabled(boolean cookieManagementDisabled)
public boolean isAuthCachingDisabled()
public void setAuthCachingDisabled(boolean authCachingDisabled)
public boolean isConnectionStateDisabled()
public void setConnectionStateDisabled(boolean connectionStateDisabled)
public boolean isDefaultUserAgentDisabled()
public void setDefaultUserAgentDisabled(boolean defaultUserAgentDisabled)
public boolean isCopyHeaders()
public void setCopyHeaders(boolean copyHeaders)
public boolean isSkipRequestHeaders()
public void setSkipRequestHeaders(boolean skipRequestHeaders)
public boolean isSkipResponseHeaders()
public void setSkipResponseHeaders(boolean skipResponseHeaders)
public String getUserAgent()
public void setUserAgent(String userAgent)
public void doStart() throws Exception
doStart
in class org.apache.camel.support.DefaultComponent
Exception
public void doStop() throws Exception
doStop
in class org.apache.camel.support.DefaultComponent
Exception
public org.apache.camel.component.extension.ComponentVerifierExtension getVerifier()
Apache Camel