Class RestfulClientFactory

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class RestfulClientFactory
    extends Object
    Base class for a REST client factory implementation
    • Constructor Detail

      • RestfulClientFactory

        public RestfulClientFactory​(ca.uhn.fhir.context.FhirContext theFhirContext)
        theFhirContext - The context
    • Method Detail

      • getConnectionRequestTimeout

        public int getConnectionRequestTimeout()
        Specified by:
        getConnectionRequestTimeout in interface
      • getConnectTimeout

        public int getConnectTimeout()
        Specified by:
        getConnectTimeout in interface
      • getProxyUsername

        protected String getProxyUsername()
        Return the proxy username to authenticate with the HTTP proxy
      • getProxyPassword

        protected String getProxyPassword()
        Return the proxy password to authenticate with the HTTP proxy
      • setProxyCredentials

        public void setProxyCredentials​(String theUsername,
                                        String thePassword)
        Specified by:
        setProxyCredentials in interface
      • getServerValidationMode

        public getServerValidationMode()
        Specified by:
        getServerValidationMode in interface
      • getSocketTimeout

        public int getSocketTimeout()
        Specified by:
        getSocketTimeout in interface
      • getPoolMaxTotal

        public int getPoolMaxTotal()
        Specified by:
        getPoolMaxTotal in interface
      • getPoolMaxPerRoute

        public int getPoolMaxPerRoute()
        Specified by:
        getPoolMaxPerRoute in interface
      • newClient

        public <T extends> T newClient​(Class<T> theClientType,
                                                                                  String theServerBase)
        Instantiates a new client instance
        Specified by:
        newClient in interface
        theClientType - The client type, which is an interface type to be instantiated
        theServerBase - The URL of the base for the restful FHIR server to connect to
        A newly created client
        ca.uhn.fhir.context.ConfigurationException - If the interface type is not an interface
      • validateConfigured

        protected void validateConfigured()
        Called automatically before the first use of this factory to ensure that the configuration is sane. Subclasses may override, but should also call super.validateConfigured()
      • newGenericClient

        public newGenericClient​(String theServerBase)
        Specified by:
        newGenericClient in interface
      • setConnectionRequestTimeout

        public void setConnectionRequestTimeout​(int theConnectionRequestTimeout)
        Specified by:
        setConnectionRequestTimeout in interface
      • setConnectTimeout

        public void setConnectTimeout​(int theConnectTimeout)
        Specified by:
        setConnectTimeout in interface
      • setFhirContext

        public void setFhirContext​(ca.uhn.fhir.context.FhirContext theContext)
        Sets the context associated with this client factory. Must not be called more than once.
      • getFhirContext

        public ca.uhn.fhir.context.FhirContext getFhirContext()
        Return the fhir context
        the fhir context
      • setServerValidationMode

        public void setServerValidationMode​( theServerValidationMode)
        Specified by:
        setServerValidationMode in interface
      • setSocketTimeout

        public void setSocketTimeout​(int theSocketTimeout)
        Specified by:
        setSocketTimeout in interface
      • setPoolMaxTotal

        public void setPoolMaxTotal​(int thePoolMaxTotal)
        Specified by:
        setPoolMaxTotal in interface
      • setPoolMaxPerRoute

        public void setPoolMaxPerRoute​(int thePoolMaxPerRoute)
        Specified by:
        setPoolMaxPerRoute in interface
      • getServerValidationModeEnum

        public getServerValidationModeEnum()
        Specified by:
        getServerValidationModeEnum in interface
      • setServerValidationModeEnum

        public void setServerValidationModeEnum​( theServerValidationMode)
        Specified by:
        setServerValidationModeEnum in interface
      • validateServerBaseIfConfiguredToDoSo

        public void validateServerBaseIfConfiguredToDoSo​(String theServerBase,
        Specified by:
        validateServerBaseIfConfiguredToDoSo in interface
      • validateServerBase

        public void validateServerBase​(String theServerBase,
        Specified by:
        validateServerBase in interface
      • getHttpClient

        protected abstract getHttpClient​(String theServerBase)
        Get the http client for the given server base
        theServerBase - the server base
        the http client
      • resetHttpClient

        protected abstract void resetHttpClient()
        Reset the http client. This method is used when parameters have been set and a new http client needs to be created