public class RestOperationConnection extends RestConnection<OperationContext>
Constructor and Description |
---|
RestOperationConnection(OperationContext context) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
doPreemptiveAuthentication(AuthenticationType type)
Returns true / false based off of the
AuthenticationType if we want to pre-emptively send
authentication information to a service. |
protected org.apache.http.auth.Credentials |
getAuthenticationCredentials(AuthenticationType authenticationType)
Creates the authentication credentials for the request based off of
AuthenticationType and
connection property values. |
protected org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> |
getAuthSchemeProviders()
Creates a Default Lookup for Authentication Scheme Providers.
|
RestClient |
getClient()
Creates a RestClient for operation execution
|
org.apache.http.entity.ContentType |
getEntityContentType()
Returns the expected content type for outbound request data.
|
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
Returns an instance of
CloseableHttpClient using HttpClientBuilder for operation execution. |
org.apache.http.protocol.HttpContext |
getHttpContext()
Creates a HttpContext, if the target
AuthenticationType needs credentials, then a credentials provider
will be setup for this context. |
protected org.apache.http.client.RedirectStrategy |
getRedirectStrategy()
Returns
RedirectStrategy based on the chosen Follow Redirects operation field. |
protected org.apache.http.client.HttpRequestRetryHandler |
getRetryHandler()
Returns a
HttpRequestRetryHandler for the getHttpClient() |
protected boolean |
useSystemProperties()
Always returns true for Rest Connector to enable using system properties by default.
|
getAuthenticationType, getAWSAccessKey, getAWSRegion, getAWSSecretKey, getAWSService, getCookieScope, getCustomAuthCredentials, getHttpMethod, getOAuthContext, getPassword, getPreemptive, getPrivateKeyStore, getPublicKeyStore, getUrl, getUsername
generateConnectionInfo, generateConnectionInfo, getConnector, getContext, getOperationContext
public RestOperationConnection(OperationContext context)
public RestClient getClient()
public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
CloseableHttpClient
using HttpClientBuilder
for operation execution.
This will configure proxy based off of AtomProxyConfig
, account/ connection certificates,
redirects based off of getRedirectStrategy()
}, cookie scope based off of RestConnection.getCookieScope()
and
authentication based registry.CloseableHttpClient
protected org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> getAuthSchemeProviders()
protected org.apache.http.client.RedirectStrategy getRedirectStrategy()
RedirectStrategy
based on the chosen Follow Redirects operation field.
If none or null redirect is specified on the operation, then the RedirectStrategy
is null.
if "LAX" is chosen on the operation, then LaxRedirectStrategy
will be used.
If "STRICT" is chosen on the operation, then the default apache client DefaultRedirectStrategy
is used.public org.apache.http.protocol.HttpContext getHttpContext()
AuthenticationType
needs credentials, then a credentials provider
will be setup for this context. In addition, only the selected AuthenticationType
scheme
will be available during authentication negotiation. If the AuthenticationType
allows pre-emptively
sending the credentials, then an AuthCache will be created for the context.protected boolean doPreemptiveAuthentication(AuthenticationType type)
AuthenticationType
if we want to pre-emptively send
authentication information to a service. BASIC and OAUTH2 is user defined, where as AWS and CUSTOM will always
pre-emptively send authentication info. DIGEST will always be false, since it will need service side authentication
information before providing the credentials.type
- protected org.apache.http.auth.Credentials getAuthenticationCredentials(AuthenticationType authenticationType)
AuthenticationType
and
connection property values.public org.apache.http.entity.ContentType getEntityContentType()
protected org.apache.http.client.HttpRequestRetryHandler getRetryHandler()
HttpRequestRetryHandler
for the getHttpClient()
protected boolean useSystemProperties()
HttpClientBuilder
class.