
Package ca.uhn.fhir.rest.server.servlet
Class ServletSubRequestDetails
java.lang.Object
ca.uhn.fhir.rest.api.server.RequestDetails
ca.uhn.fhir.rest.server.servlet.ServletRequestDetails
ca.uhn.fhir.rest.server.servlet.ServletSubRequestDetails
- All Implemented Interfaces:
IHasServletAttributes
This class wraps a
ServletRequestDetails object for
processing sub-requests, such as processing individual
entries in a transaction or batch bundle. An instance of this class is used for modifying some of the data
in the request details, such as the request headers, for an individual entry,
without affecting the original ServletRequestDetails.-
Field Summary
Fields inherited from class ca.uhn.fhir.rest.api.server.RequestDetails
BAD_STREAM_PLACEHOLDER -
Constructor Summary
ConstructorsConstructorDescriptionServletSubRequestDetails(ServletRequestDetails theRequestDetails) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new headergetHeaders(String theName) jakarta.servlet.http.HttpServletRequestjakarta.servlet.http.HttpServletResponseReturns a map which can be used to hold any user specific data to pass it from one part of the request handling chain to another.booleanIs this request a sub-request (i.e. a request within a batch or transaction)?voidsetHeaders(String theName, List<String> theValues) Replaces any existing header(s) with the given name using a List of new header valuesMethods inherited from class ca.uhn.fhir.rest.server.servlet.ServletRequestDetails
getAttribute, getByteStreamRequestContents, getCharset, getFhirContext, getHeaders, getInputStream, getReader, getServer, getServerBaseForRequest, getServletAttribute, isPreferRespondAsync, setAttribute, setServer, setServletAttribute, setServletRequest, setServletResponseMethods inherited from class ca.uhn.fhir.rest.api.server.RequestDetails
addParameter, getCompartmentName, getCompleteUrl, getConditionalUrl, getFhirServerBase, getFixedConditionalUrl, getId, getInterceptorBroadcaster, getMaxRetries, getOperation, getParameters, getRequestContentsIfLoaded, getRequestId, getRequestPath, getRequestStopwatch, getRequestType, getResource, getResourceName, getResponse, getRestOperationType, getSecondaryOperation, getTenantId, getTransactionGuid, getUnqualifiedToQualifiedNames, isPreferAsync, isRespondGzip, isRetry, isRewriteHistory, loadRequestContents, removeParameter, setCompartmentName, setCompleteUrl, setFhirServerBase, setFixedConditionalUrl, setId, setMaxRetries, setOperation, setParameters, setRequestContents, setRequestId, setRequestPath, setRequestType, setResource, setResourceName, setRespondGzip, setResponse, setRestOperationType, setRetry, setRewriteHistory, setSecondaryOperation, setSubRequest, setTenantId, setTransactionGuid
-
Constructor Details
-
ServletSubRequestDetails
Constructor- Parameters:
theRequestDetails- The parent request details
-
-
Method Details
-
getServletRequest
- Overrides:
getServletRequestin classServletRequestDetails
-
getServletResponse
- Overrides:
getServletResponsein classServletRequestDetails
-
addHeader
Description copied from class:RequestDetailsAdds a new header- Overrides:
addHeaderin classServletRequestDetails- Parameters:
theName- The header nametheValue- The header value
-
getHeader
- Overrides:
getHeaderin classServletRequestDetails
-
getHeaders
- Overrides:
getHeadersin classServletRequestDetails
-
setHeaders
Description copied from class:RequestDetailsReplaces any existing header(s) with the given name using a List of new header values- Overrides:
setHeadersin classServletRequestDetails- Parameters:
theName- The header nametheValues- The header value
-
getUserData
Description copied from class:RequestDetailsReturns a map which can be used to hold any user specific data to pass it from one part of the request handling chain to another. Data in this map can use any key, although user code should try to use keys which are specific enough to avoid conflicts.A new map is created for each individual request that is handled by the server, so this map can be used (for example) to pass authorization details from an interceptor to the resource providers, or for example to pass data from a hook method on the
Pointcut.SERVER_INCOMING_REQUEST_POST_PROCESSEDto a later hook method on thePointcut.SERVER_OUTGOING_RESPONSEpointcut.This method should be used to pass information between interceptor methods. For servlet-specific request attributes used to communicate between servlet filters, use
IHasServletAttributesmethods available on implementations that support them.- Overrides:
getUserDatain classRequestDetails
-
isSubRequest
Description copied from class:RequestDetailsIs this request a sub-request (i.e. a request within a batch or transaction)? This flag is used internally by hapi-fhir-jpaserver-base, but not used in the plain server library. You may use it in your client code as a hint when implementing transaction logic in the plain server.Defaults to false
- Overrides:
isSubRequestin classRequestDetails
-