public abstract class BaseConnectionProvider extends Object implements org.mule.runtime.api.connection.CachedConnectionProvider<RestConnection>, org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
| Constructor and Description |
|---|
BaseConnectionProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected org.mule.runtime.http.api.client.auth.HttpAuthentication |
buildAuthentication()
Implementations can override this method to specify the authentication mechanism to use.
|
protected void |
configureClient(org.mule.runtime.http.api.client.HttpClientConfiguration.Builder httpConfiguration)
Template method that will be invoked just before the
httpConfiguration is turned into an actual HttpClient. |
RestConnection |
connect() |
protected RestConnection |
createConnection(org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.http.api.client.auth.HttpAuthentication authentication,
org.mule.runtime.api.util.MultiMap<String,String> defaultQueryParams,
org.mule.runtime.api.util.MultiMap<String,String> defaultHeaders)
Creates a new
RestConnection |
void |
disconnect(RestConnection restConnection) |
abstract String |
getBaseUri() |
protected String |
getConfigName() |
protected Integer |
getConnectionIdleTimeout() |
protected TimeUnit |
getConnectionIdleTimeoutUnit() |
protected Integer |
getConnectionTimeout() |
protected TimeUnit |
getConnectionTimeoutUnit() |
List<RequestHeader> |
getDefaultHeaders() |
List<QueryParam> |
getDefaultQueryParams() |
protected org.mule.runtime.api.el.ExpressionLanguage |
getExpressionLanguage() |
protected Integer |
getMaxConnections() |
protected HttpProxyConfig |
getProxyConfig() |
protected int |
getResponseBufferSize() |
protected Optional<TlsParameterGroup> |
getTlsConfig()
TLS secured implementations MUST override this method to provide the
TlsParameterGroup that configures TLS. |
void |
initialise() |
protected boolean |
isStreamResponse() |
protected boolean |
isUsePersistentConnections() |
void |
start()
Starts the resources related to this connection provider.
|
void |
stop()
Stops the started resources related to this connection provider.
|
org.mule.runtime.api.connection.ConnectionValidationResult |
validate(RestConnection restConnection) |
protected org.mule.runtime.api.connection.ConnectionValidationResult |
validate(RestConnection restConnection,
ConnectionValidationSettings settings) |
public abstract String getBaseUri()
public final void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
start in interface org.mule.runtime.api.lifecycle.Startablepublic void stop()
stop in interface org.mule.runtime.api.lifecycle.Stoppablepublic final RestConnection connect() throws org.mule.runtime.api.connection.ConnectionException
connect in interface org.mule.runtime.api.connection.ConnectionProvider<RestConnection>org.mule.runtime.api.connection.ConnectionExceptionprotected RestConnection createConnection(org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.http.api.client.auth.HttpAuthentication authentication, org.mule.runtime.api.util.MultiMap<String,String> defaultQueryParams, org.mule.runtime.api.util.MultiMap<String,String> defaultHeaders)
RestConnectionhttpClient - the client to perform the requestsauthentication - a nullable authentication mechanismRestConnectionprotected org.mule.runtime.http.api.client.auth.HttpAuthentication buildAuthentication()
HttpAuthentication or nullpublic final void disconnect(RestConnection restConnection)
disconnect in interface org.mule.runtime.api.connection.ConnectionProvider<RestConnection>public org.mule.runtime.api.connection.ConnectionValidationResult validate(RestConnection restConnection)
validate in interface org.mule.runtime.api.connection.ConnectionProvider<RestConnection>protected org.mule.runtime.api.connection.ConnectionValidationResult validate(RestConnection restConnection, ConnectionValidationSettings settings)
protected void configureClient(org.mule.runtime.http.api.client.HttpClientConfiguration.Builder httpConfiguration)
httpConfiguration is turned into an actual HttpClient.
It gives implementations a chance to do extra configurations.httpConfiguration - the configuration builder for the HttpClient about to be created.protected Optional<TlsParameterGroup> getTlsConfig()
TlsParameterGroup that configures TLS.TlsParameterGroupprotected String getConfigName()
public List<RequestHeader> getDefaultHeaders()
public List<QueryParam> getDefaultQueryParams()
protected Integer getConnectionTimeout()
protected TimeUnit getConnectionTimeoutUnit()
protected boolean isUsePersistentConnections()
protected Integer getMaxConnections()
protected Integer getConnectionIdleTimeout()
protected TimeUnit getConnectionIdleTimeoutUnit()
protected HttpProxyConfig getProxyConfig()
protected boolean isStreamResponse()
protected int getResponseBufferSize()
protected org.mule.runtime.api.el.ExpressionLanguage getExpressionLanguage()
Copyright © 2021. All rights reserved.