Interface IClientExecutable<T extends IClientExecutable<?,Y>,Y>
- All Known Subinterfaces:
ICreateTyped
,ICreateWithQueryTyped
,IDeleteTyped
,IDeleteWithQueryTyped
,IFetchConformanceTyped<T>
,IGetPageTyped<T>
,IHistoryTyped<T>
,IOperationProcessMsgMode<T>
,IOperationUntypedWithInput<T>
,IOperationUntypedWithInputAndPartialOutput<T>
,IPatchExecutable
,IPatchWithBody
,IPatchWithQueryTyped
,IQuery<Y>
,IReadExecutable<T>
,ITransactionTyped<T>
,IUpdateExecutable
,IUpdateTyped
,IUpdateWithQueryTyped
,IValidateUntyped
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies a customAccept
header that should be supplied with the request.andLogRequestAndResponse
(boolean theLogRequestAndResponse) Deprecated.Use the client logging interceptor to log requests and responses instead.cacheControl
(CacheControlDirective theCacheControlDirective) Sets theCache-Control
header value, which advises the server (or any cache in front of it) how to behave in terms of cached requestselementsSubset
(String... theElements) Request that the server return subsetted resources, containing only the elements specified in the given parameters.encoded
(EncodingEnum theEncoding) Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.execute()
Actually execute the client operationpreferResponseType
(Class<? extends IBaseResource> theType) Explicitly specify a custom structure type to attempt to use when parsing the response.preferResponseTypes
(List<Class<? extends IBaseResource>> theTypes) Explicitly specify a list of custom structure types to attempt to use (in order from most to least preferred) when parsing the response.Request pretty-printed response via the_pretty
parametersummaryMode
(SummaryEnum theSummary) Request that the server modify the response using the_summary
paramwithAdditionalHeader
(String theHeaderName, String theHeaderValue) Set a HTTP header not explicitly defined in FHIR but commonly used in real-world scenarios.
-
Method Details
-
andLogRequestAndResponse
Deprecated.Use the client logging interceptor to log requests and responses instead. See here for more information.If set to true, the client will log the request and response to the SLF4J logger. This can be useful for debugging, but is generally not desirable in a production situation. -
cacheControl
Sets theCache-Control
header value, which advises the server (or any cache in front of it) how to behave in terms of cached requests -
elementsSubset
Request that the server return subsetted resources, containing only the elements specified in the given parameters. For example:subsetElements("name", "identifier")
requests that the server only return the "name" and "identifier" fields in the returned resource, and omit any others. -
encoded
Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.This method will have no effect if
a custom Accept header
is specified.- See Also:
-
encodedJson
T encodedJson()Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.This method will have no effect if
a custom Accept header
is specified.- See Also:
-
encodedXml
T encodedXml()Request that the server respond with JSON via the Accept header and possibly also the_format
parameter ifconfigured to do so
.This method will have no effect if
a custom Accept header
is specified.- See Also:
-
withAdditionalHeader
Set a HTTP header not explicitly defined in FHIR but commonly used in real-world scenarios. One important example is to set the Authorization header (e.g. Basic Auth or OAuth2-based Bearer auth), which tends to be cumbersome usingIClientInterceptors
, particularly when REST clients shall be reused and are thus supposed to remain stateless.It is the responsibility of the caller to care for proper encoding of the header value, e.g. using Base64.
This is a short-cut alternative to using a corresponding client interceptor
- Parameters:
theHeaderName
- header nametheHeaderValue
- header value- Returns:
-
execute
Actually execute the client operation -
preferResponseType
Explicitly specify a custom structure type to attempt to use when parsing the response. This is useful for invocations where the response is a Bundle/Parameters containing nested resources, and you want to use specific custom structures for those nested resources.See Profiles and Extensions for more information on using custom structures
-
preferResponseTypes
Explicitly specify a list of custom structure types to attempt to use (in order from most to least preferred) when parsing the response. This is useful for invocations where the response is a Bundle/Parameters containing nested resources, and you want to use specific custom structures for those nested resources.See Profiles and Extensions for more information on using custom structures
-
prettyPrint
T prettyPrint()Request pretty-printed response via the_pretty
parameter -
summaryMode
Request that the server modify the response using the_summary
param -
accept
Specifies a customAccept
header that should be supplied with the request.Note that this method overrides any encoding preferences specified with
encodedJson()
orencodedXml()
. It is generally easier to just use those methods if you simply want to request a specific FHIR encoding.- Parameters:
theHeaderValue
- The header value, e.g. "application/fhir+json". Constants such asConstants.CT_FHIR_XML_NEW
andConstants.CT_FHIR_JSON_NEW
may be useful. If set tonull
or an empty string, the default Accept header will be used.- See Also:
-