Interface HttpRestClient

  • All Superinterfaces:
    org.refcodes.net.BaseUrlAccessor, org.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<HttpRestClient>, org.refcodes.net.BaseUrlAccessor.BaseUrlMutator, org.refcodes.net.BaseUrlAccessor.BaseUrlProperty, org.refcodes.component.Closable, org.refcodes.component.ConnectionComponent<org.refcodes.net.HttpClientContext>, org.refcodes.component.ConnectionOpenable<org.refcodes.net.HttpClientContext>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.LinkComponent, org.refcodes.net.MediaTypeFactoryLookup, org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.component.Openable, org.refcodes.runtime.RequestCorrelation<RestClient>, RestClient, RestDeleteClient, RestGetClient, RestPostClient, RestPutClient, RestRequestClient, org.refcodes.runtime.SessionCorrelation<RestClient>, org.refcodes.security.TrustStoreDescriptorAccessor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<HttpRestClient>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.net.UserAgentAccessor, org.refcodes.net.UserAgentAccessor.UserAgentBuilder<RestClient>, org.refcodes.net.UserAgentAccessor.UserAgentMutator, org.refcodes.net.UserAgentAccessor.UserAgentProperty
    All Known Subinterfaces:
    HttpDiscoveryRestClient<B>
    All Known Implementing Classes:
    AbstractHttpDiscoveryRestClientDecorator, AbstractHttpRestClientDecorator, HttpRestClientImpl, HttpRestClientSingleton

    public interface HttpRestClient
    extends org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.ConnectionComponent<org.refcodes.net.HttpClientContext>, RestClient, org.refcodes.component.LinkComponent, org.refcodes.net.BaseUrlAccessor.BaseUrlProperty, org.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<HttpRestClient>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<HttpRestClient>
    Extends a RestClient 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) ( BaseUrlAccessor.BaseUrlBuilder.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 HttpRestClient can be shutdown via Closable.close().
    • Field Detail

      • DEFAULT_SSL_PROTOCOL

        static final java.lang.String DEFAULT_SSL_PROTOCOL
        See Also:
        Constant Field Values
      • DEFAULT_KEYSTORE_TYPE

        static final java.lang.String DEFAULT_KEYSTORE_TYPE
    • Method Detail

      • open

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

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

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

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

        void open​(org.refcodes.net.Url aBaseUrl,
                  org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
           throws org.refcodes.component.OpenException
        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:
        org.refcodes.component.OpenException - thrown in case something went wrong.
      • withTrustStoreDescriptor

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

        default HttpRestClient withUserAgent​(java.lang.String aUserAgent)
        Specified by:
        withUserAgent in interface RestClient
        Specified by:
        withUserAgent in interface org.refcodes.net.UserAgentAccessor.UserAgentBuilder<RestClient>