public abstract class RestConnectionProvider<C extends RestConnection> extends Object implements org.mule.runtime.api.connection.CachedConnectionProvider<C>, org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
| Modifier and Type | Field and Description |
|---|---|
protected org.mule.runtime.http.api.HttpService |
httpService |
| Constructor and Description |
|---|
RestConnectionProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected org.mule.runtime.http.api.client.auth.HttpAuthentication |
buildAuthentication() |
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. |
C |
connect() |
protected abstract C |
createConnection(org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.http.api.client.HttpRequestOptions httpRequestOptions)
Creates a new connection
C |
void |
disconnect(C connection) |
abstract String |
getBaseUri() |
protected Optional<Integer> |
getResponseTimeout() |
void |
initialise() |
protected Optional<Boolean> |
isFollowsRedirect() |
void |
start()
Starts the resources related to this connection provider.
|
void |
stop()
Stops the started resources related to this connection provider.
|
public abstract String getBaseUri()
public final C connect() throws org.mule.runtime.api.connection.ConnectionException
connect in interface org.mule.runtime.api.connection.ConnectionProvider<C extends RestConnection>org.mule.runtime.api.connection.ConnectionExceptionprotected abstract C createConnection(org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.http.api.client.HttpRequestOptions httpRequestOptions)
ChttpClient - the client to perform the requests.httpRequestOptions - the options for the http request client to perfom the requests.Cpublic final void disconnect(C connection)
disconnect in interface org.mule.runtime.api.connection.ConnectionProvider<C extends RestConnection>public 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.Stoppableprotected 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 org.mule.runtime.http.api.client.auth.HttpAuthentication buildAuthentication()
HttpAuthentication defined by the connection provider or null. This allows implementations to
support custom authentications by defining at the implementation class the parameters for filling the authentication.protected Optional<Integer> getResponseTimeout()
protected Optional<Boolean> isFollowsRedirect()
Copyright © 2022. All rights reserved.