Class RestOperationConnection

    • Constructor Detail

      • RestOperationConnection

        public RestOperationConnection​(OperationContext context)
    • Method Detail

      • getClient

        public RestClient getClient()
        Creates a RestClient for operation execution
        Returns:
        the RestClient
      • getAuthSchemeProviders

        protected Lookup<AuthSchemeProvider> getAuthSchemeProviders()
        Creates a Default Lookup for Authentication Scheme Providers.
        Returns:
        the AuthSchemeProvider Lookup
      • getRedirectStrategy

        protected RedirectStrategy getRedirectStrategy()
        Returns 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.
        Returns:
        the RedirectStrategy
      • configureCookieScope

        protected void configureCookieScope​(HttpClientBuilder builder)
                                     throws IllegalArgumentException
        Enables or disables cookie management of the given HttpClientBuilder instance based on the value of "Cookie Scope" connection property. Global cookie store is used when the "Cookie Scope" connection property is set to GLOBAL. In this case, cookies are shared across all the processes. Http Client's default cookie store is used and cookies are isolated to respective connector execution when the "Cookie Scope" connection property is null or missing or set to CONNECTOR_SHAPE. Cookies are disabled when the "Cookie Scope" connection property is set to IGNORED.
        Throws:
        IllegalArgumentException - if the Cookie Scope property is set with an invalid value.
      • addCookiesToStore

        protected void addCookiesToStore​(BasicCookieStore cookieStore)
      • getHttpContext

        public HttpContext getHttpContext()
        Creates a HttpContext, if the target 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.
        Returns:
        the Http Client Context
      • doPreemptiveAuthentication

        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. 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.
        Parameters:
        type -
        Returns:
        true when PreemptivelyAuthenticate false otherwise.
      • getAuthenticationCredentials

        protected Credentials getAuthenticationCredentials​(AuthenticationType authenticationType)
        Creates the authentication credentials for the request based off of AuthenticationType and connection property values.
        Returns:
        the authentication Credentials
      • getEntityContentType

        public ContentType getEntityContentType()
        Returns the expected content type for outbound request data.
        Returns:
        the ContentType
      • useSystemProperties

        protected boolean useSystemProperties()
        Always returns true for Rest Connector to enable using system properties by default. System properties will be taken into account when configuring the default implementations within HttpClientBuilder class.
      • buildRequestConfig

        protected RequestConfig buildRequestConfig​(AuthenticationType authType)
        Method to populate the RequestConfig to be used in the HttpContext at the time of the request. Will set both Connect and Read timeouts if available.
        Parameters:
        authType - The authenticationType that is used for the request
        Returns:
        The RequestConfig with Auth schemes and timeouts set