Package ca.uhn.fhir.rest.client.impl
Class BaseClient
- java.lang.Object
-
- ca.uhn.fhir.rest.client.impl.BaseClient
-
- All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IRestfulClient
- Direct Known Subclasses:
ClientInvocationHandler,GenericClient
public abstract class BaseClient extends Object implements ca.uhn.fhir.rest.client.api.IRestfulClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBaseClient.ResourceOrBinaryResponseHandlerprotected classBaseClient.ResourceResponseHandler<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
Field Summary
Fields Modifier and Type Field Description static StringHAPI_CLIENT_KEEPRESPONSESThis property is used by unit tests - do not rely on it in production code as it may change at any time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,List<String>>createExtraParams(String theCustomAcceptHeader)<T extends org.hl7.fhir.instance.model.api.IBaseResource>
TfetchResourceFromUrl(Class<T> theResourceType, String theUrl)ca.uhn.fhir.rest.api.EncodingEnumgetEncoding()ca.uhn.fhir.rest.client.api.IHttpClientgetHttpClient()ca.uhn.fhir.interceptor.api.IInterceptorServicegetInterceptorService()ca.uhn.fhir.rest.client.api.IHttpResponsegetLastResponse()For now, this is a part of the internal API of HAPI - Use with caution as this method may change!StringgetLastResponseBody()For now, this is a part of the internal API of HAPI - Use with caution as this method may change!StringgetServerBase()ca.uhn.fhir.rest.api.SummaryEnumgetSummary()StringgetUrlBase()booleanisKeepResponses()For now, this is a part of the internal API of HAPI - Use with caution as this method may change!booleanisPrettyPrint()Returns the pretty print flag, which is a request to the server for it to return "pretty printed" responses.voidregisterInterceptor(ca.uhn.fhir.rest.client.api.IClientInterceptor theInterceptor)voidsetDontValidateConformance(boolean theDontValidateConformance)This method is an internal part of the HAPI API and may change, use with caution.voidsetEncoding(ca.uhn.fhir.rest.api.EncodingEnum theEncoding)Sets the encoding that will be used on requests.voidsetFormatParamStyle(ca.uhn.fhir.rest.api.RequestFormatParamStyleEnum theRequestFormatParamStyle)voidsetInterceptorService(ca.uhn.fhir.interceptor.api.IInterceptorService theInterceptorService)voidsetKeepResponses(boolean theKeepResponses)For now, this is a part of the internal API of HAPI - Use with caution as this method may change!voidsetPrettyPrint(Boolean thePrettyPrint)Sets the pretty print flag, which is a request to the server for it to return "pretty printed" responses.voidsetSummary(ca.uhn.fhir.rest.api.SummaryEnum theSummary)voidunregisterInterceptor(ca.uhn.fhir.rest.client.api.IClientInterceptor theInterceptor)
-
-
-
Field Detail
-
HAPI_CLIENT_KEEPRESPONSES
public static final String HAPI_CLIENT_KEEPRESPONSES
This property is used by unit tests - do not rely on it in production code as it may change at any time. If you want to capture responses in a reliable way in your own code, just use client interceptors- See Also:
- Constant Field Values
-
-
Method Detail
-
getInterceptorService
public ca.uhn.fhir.interceptor.api.IInterceptorService getInterceptorService()
- Specified by:
getInterceptorServicein interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
setInterceptorService
public void setInterceptorService(@Nonnull ca.uhn.fhir.interceptor.api.IInterceptorService theInterceptorService)
- Specified by:
setInterceptorServicein interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
createExtraParams
protected Map<String,List<String>> createExtraParams(String theCustomAcceptHeader)
-
fetchResourceFromUrl
public <T extends org.hl7.fhir.instance.model.api.IBaseResource> T fetchResourceFromUrl(Class<T> theResourceType, String theUrl)
- Specified by:
fetchResourceFromUrlin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
getEncoding
public ca.uhn.fhir.rest.api.EncodingEnum getEncoding()
- Specified by:
getEncodingin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
setEncoding
public void setEncoding(ca.uhn.fhir.rest.api.EncodingEnum theEncoding)
Sets the encoding that will be used on requests. Default isnull, which means the client will not explicitly request an encoding. (This is perfectly acceptable behaviour according to the FHIR specification. In this case, the server will choose which encoding to return, and the client can handle either XML or JSON)- Specified by:
setEncodingin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
getHttpClient
public ca.uhn.fhir.rest.client.api.IHttpClient getHttpClient()
- Specified by:
getHttpClientin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
getLastResponse
public ca.uhn.fhir.rest.client.api.IHttpResponse getLastResponse()
For now, this is a part of the internal API of HAPI - Use with caution as this method may change!
-
getLastResponseBody
public String getLastResponseBody()
For now, this is a part of the internal API of HAPI - Use with caution as this method may change!
-
getServerBase
public String getServerBase()
- Specified by:
getServerBasein interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
getSummary
public ca.uhn.fhir.rest.api.SummaryEnum getSummary()
-
setSummary
public void setSummary(ca.uhn.fhir.rest.api.SummaryEnum theSummary)
- Specified by:
setSummaryin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
getUrlBase
public String getUrlBase()
-
setFormatParamStyle
public void setFormatParamStyle(ca.uhn.fhir.rest.api.RequestFormatParamStyleEnum theRequestFormatParamStyle)
- Specified by:
setFormatParamStylein interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
isKeepResponses
public boolean isKeepResponses()
For now, this is a part of the internal API of HAPI - Use with caution as this method may change!
-
setKeepResponses
public void setKeepResponses(boolean theKeepResponses)
For now, this is a part of the internal API of HAPI - Use with caution as this method may change!
-
isPrettyPrint
public boolean isPrettyPrint()
Returns the pretty print flag, which is a request to the server for it to return "pretty printed" responses. Note that this is currently a non-standard flag (_pretty) which is supported only by HAPI based servers (and any other servers which might implement it).
-
setPrettyPrint
public void setPrettyPrint(Boolean thePrettyPrint)
Sets the pretty print flag, which is a request to the server for it to return "pretty printed" responses. Note that this is currently a non-standard flag (_pretty) which is supported only by HAPI based servers (and any other servers which might implement it).- Specified by:
setPrettyPrintin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
registerInterceptor
public void registerInterceptor(ca.uhn.fhir.rest.client.api.IClientInterceptor theInterceptor)
- Specified by:
registerInterceptorin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
setDontValidateConformance
public void setDontValidateConformance(boolean theDontValidateConformance)
This method is an internal part of the HAPI API and may change, use with caution. If you want to disable the loading of conformance statements, useIRestfulClientFactory.setServerValidationModeEnum(ServerValidationModeEnum)
-
unregisterInterceptor
public void unregisterInterceptor(ca.uhn.fhir.rest.client.api.IClientInterceptor theInterceptor)
- Specified by:
unregisterInterceptorin interfaceca.uhn.fhir.rest.client.api.IRestfulClient
-
-