public class DefaultConfigurator extends Object implements ClientConfigurator, HasEffectiveClientConfigurator, SetsClientBuilderProperties
DefaultConfigurator handles basic configuration of clients under different environments. This is the configurator used by the REST client factory when no configurator is provided by the SDK user.
It currently does the following:
If the default configurator results in any issues, callers can provide their own implementation when constructing service objects.
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultConfigurator.NonBuffering
A
ClientConfigurator for a client that does not buffer requests in memory. |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
APACHE_CONNECTOR_CLASS_NAME |
protected static String |
APACHE_HTTP_CLIENT_CONFIG_CLASS_NAME |
protected List<ClientConfigDecorator> |
clientConfigDecorators
The list of
ClientConfigDecorators to support the ability to decorate ClientConfig |
| Constructor and Description |
|---|
DefaultConfigurator()
Creates a new
DefaultConfigurator object. |
DefaultConfigurator(List<ClientConfigDecorator> clientConfigDecorators)
Creates a new
DefaultConfigurator and registers the list of provided ClientConfigDecorators. |
| Modifier and Type | Method and Description |
|---|---|
void |
customizeBuilder(javax.ws.rs.client.ClientBuilder builder)
Customize the ClientBuilder instance.
|
void |
customizeClient(javax.ws.rs.client.Client client)
Customize the Client generated by the builder.
|
void |
customizeRequest(BmcRequest<?> request,
WrappedInvocationBuilder ib)
Customize a request before it is made.
|
ClientConfigurator |
getEffectiveClientConfigurator()
Get the effective ClientConfigurator
|
static boolean |
isApacheDependencyPresent() |
void |
setConnectorProvider(javax.ws.rs.client.ClientBuilder builder)
Sets the custom ConnectorProvider to use.
|
void |
setSslContext(javax.ws.rs.client.ClientBuilder builder)
Sets the SSL context on the builder.
|
protected static final String APACHE_HTTP_CLIENT_CONFIG_CLASS_NAME
protected static final String APACHE_CONNECTOR_CLASS_NAME
protected final List<ClientConfigDecorator> clientConfigDecorators
The list of ClientConfigDecorators to support the ability to decorate ClientConfig
public DefaultConfigurator()
Creates a new DefaultConfigurator object.
public DefaultConfigurator(List<ClientConfigDecorator> clientConfigDecorators)
Creates a new DefaultConfigurator and registers the list of provided ClientConfigDecorators.
clientConfigDecorators - the list of client configuration decoratorspublic static boolean isApacheDependencyPresent()
public void customizeBuilder(javax.ws.rs.client.ClientBuilder builder)
ClientConfiguratorCustomize the ClientBuilder instance.
customizeBuilder in interface ClientConfiguratorbuilder - The client builder.public void customizeClient(javax.ws.rs.client.Client client)
ClientConfiguratorCustomize the Client generated by the builder.
customizeClient in interface ClientConfiguratorclient - The client.public void setConnectorProvider(javax.ws.rs.client.ClientBuilder builder)
Sets the custom ConnectorProvider to use. Subclasses can override this to be a no-op if they do not want to use the custom connector, or wish to set their own.
setConnectorProvider in interface SetsClientBuilderPropertiesbuilder - The builder to set the provider onpublic void setSslContext(javax.ws.rs.client.ClientBuilder builder)
Sets the SSL context on the builder.
Separate so subclasses can call if desired.
setSslContext in interface SetsClientBuilderPropertiesbuilder - The client builder to use.public void customizeRequest(BmcRequest<?> request, WrappedInvocationBuilder ib)
ClientConfiguratorCustomize a request before it is made.
customizeRequest in interface ClientConfiguratorrequest - The requestib - the invocation builderpublic ClientConfigurator getEffectiveClientConfigurator()
HasEffectiveClientConfiguratorGet the effective ClientConfigurator
getEffectiveClientConfigurator in interface HasEffectiveClientConfiguratorCopyright © 2016–2022. All rights reserved.