Interface RestfulHttpClient

All Superinterfaces:
org.refcodes.web.BaseUrlAccessor, org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>, org.refcodes.web.BaseUrlAccessor.BaseUrlMutator, org.refcodes.web.BaseUrlAccessor.BaseUrlProperty, org.refcodes.web.BasicAuthCredentialsAccessor, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty, org.refcodes.component.Closable, org.refcodes.component.ConnectionComponent<org.refcodes.web.HttpClientContext>, org.refcodes.component.ConnectionOpenable<org.refcodes.web.HttpClientContext>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.web.HttpClientInterceptable, org.refcodes.component.LinkComponent, org.refcodes.web.MediaTypeFactoryLookup, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.OauthTokenAccessor, org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestfulClient>, org.refcodes.web.OauthTokenAccessor.OauthTokenMutator, org.refcodes.web.OauthTokenAccessor.OauthTokenProperty, org.refcodes.component.Openable, org.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>, org.refcodes.component.OpenedAccessor, org.refcodes.web.PostHttpClientInterceptable, org.refcodes.web.PostHttpInterceptable<org.refcodes.web.PostHttpClientInterceptor>, org.refcodes.web.PreHttpClientInterceptable, org.refcodes.web.PreHttpInterceptable<org.refcodes.web.PreHttpClientInterceptor>, RestDeleteClient, RestfulClient, RestGetClient, RestPostClient, RestPutClient, RestRequestClient, RestRequestHandler, org.refcodes.security.TrustStoreDescriptorAccessor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<RestfulHttpClient>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.web.UserAgentAccessor, org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestfulClient>, org.refcodes.web.UserAgentAccessor.UserAgentMutator, org.refcodes.web.UserAgentAccessor.UserAgentProperty
All Known Subinterfaces:
RestfulHttpDiscoveryClient<B>
All Known Implementing Classes:
AbstractRestfulHttpClientDecorator, AbstractRestfulHttpDiscoveryClientDecorator, HttpRestClient, HttpRestClientSingleton

public interface RestfulHttpClient extends RestfulClient, org.refcodes.web.HttpClientInterceptable, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.ConnectionComponent<org.refcodes.web.HttpClientContext>, org.refcodes.component.LinkComponent, org.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>, org.refcodes.web.BaseUrlAccessor.BaseUrlProperty, org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<RestfulHttpClient>
Extends a RestfulClient to be capable of providing a User-Agent with UserAgentAccessor.UserAgentMutator.setUserAgent(String) (withUserAgent(String)) and to be capable of using base URLs to be set with BaseUrlAccessor.BaseUrlMutator.setBaseUrl(String) ( withBaseUrl(String)). This type is intended to be used by different separate hierarchy branches by providing the generic type <B>, ensuring a coherent type hierarchy for each branch. To prepare HTTPS connections, use the methods such as: open(Url, TrustStoreDescriptor) or open(HttpClientContext). A RestfulHttpClient can be shutdown via Closable.close().
  • Field Details

  • Method Details

    • open

      default void open() throws IOException
      Specified by:
      open in interface org.refcodes.component.Openable
      Throws:
      IOException
    • open

      default void open(org.refcodes.web.HttpClientContext aCtx) throws IOException
      Specified by:
      open in interface org.refcodes.component.ConnectionOpenable<org.refcodes.web.HttpClientContext>
      Throws:
      IOException
    • open

      default void open(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aStoreDescriptor - The TrustStoreDescriptor pointing to your KeyStore.
      Throws:
      IOException - thrown in case something went wrong.
    • open

      default void open(org.refcodes.web.Url aBaseUrl) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aBaseUrl - The base Url to be used.
      Throws:
      IOException - thrown in case something went wrong.
    • open

      void open(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aBaseUrl - The base Url to be used.
      aStoreDescriptor - The TrustStoreDescriptor pointing to your KeyStore.
      Throws:
      IOException - thrown in case something went wrong.
    • withOpen

      default RestfulHttpClient withOpen() throws IOException
      Open the component's connection(s).
      Specified by:
      withOpen in interface org.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>
      Returns:
      This instance as of the builder pattern.
      Throws:
      IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
    • withOpen

      default RestfulHttpClient withOpen(org.refcodes.web.HttpClientContext aCtx) throws IOException
      Opens the component with the given connection.
      Parameters:
      aCtx - The context used for opening the connection.
      Returns:
      This instance as of the builder pattern.
      Throws:
      IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
    • withOpen

      default RestfulHttpClient withOpen(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aStoreDescriptor - The TrustStoreDescriptor pointing to your KeyStore.
      Returns:
      This instance as of the builder pattern.
      Throws:
      IOException - thrown in case something went wrong.
    • withOpen

      default RestfulHttpClient withOpen(org.refcodes.web.Url aBaseUrl) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aBaseUrl - The base Url to be used.
      Returns:
      This instance as of the builder pattern.
      Throws:
      IOException - thrown in case something went wrong.
    • withOpen

      default RestfulHttpClient withOpen(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException
      Configures the HTTPS client connection with the provided configuration parameters.
      Parameters:
      aBaseUrl - The base Url to be used.
      aStoreDescriptor - The TrustStoreDescriptor pointing to your KeyStore.
      Returns:
      This instance as of the builder pattern.
      Throws:
      IOException - thrown in case something went wrong.
    • withBaseUrl

      default RestfulHttpClient withBaseUrl(String aBaseUrl) throws MalformedURLException
      Specified by:
      withBaseUrl in interface org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
      Throws:
      MalformedURLException
    • withBaseUrl

      default RestfulHttpClient withBaseUrl(org.refcodes.web.Url aBaseUrl)
      Specified by:
      withBaseUrl in interface org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
    • withBaseUrl

      default RestfulHttpClient withBaseUrl(URL aBaseURL)
      Specified by:
      withBaseUrl in interface org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
    • withBasicAuthCredentials

      default RestfulHttpClient withBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials)
      Specified by:
      withBasicAuthCredentials in interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>
    • withBasicAuthCredentials

      default RestfulHttpClient withBasicAuthCredentials(String aUserName, String aSecret)
      Specified by:
      withBasicAuthCredentials in interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>
    • withOAuthToken

      default RestfulHttpClient withOAuthToken(org.refcodes.web.OauthToken aOauthToken)
      Specified by:
      withOAuthToken in interface org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestfulClient>
    • withTrustStoreDescriptor

      default RestfulHttpClient withTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
      Specified by:
      withTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<RestfulHttpClient>
    • withUserAgent

      default RestfulHttpClient withUserAgent(String aUserAgent)
      Specified by:
      withUserAgent in interface org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestfulClient>