Package ca.uhn.fhir.rest.server.servlet
Class ServletRequestDetails
- java.lang.Object
-
- ca.uhn.fhir.rest.api.server.RequestDetails
-
- ca.uhn.fhir.rest.server.servlet.ServletRequestDetails
-
- Direct Known Subclasses:
ServletSubRequestDetails
public class ServletRequestDetails extends RequestDetails
-
-
Constructor Summary
Constructors Constructor Description ServletRequestDetails(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String theAttributeName)Returns the attribute map for this request.protected byte[]getByteStreamRequestContents()CharsetgetCharset()Return the charset as defined by the header contenttype.ca.uhn.fhir.context.FhirContextgetFhirContext()Returns the HAPI FHIR Context associated with this requestStringgetHeader(String name)Map<String,List<String>>getHeaders()List<String>getHeaders(String name)InputStreamgetInputStream()Retrieves the body of the request as binary data.ReadergetReader()Retrieves the body of the request as character data using aBufferedReader.RestfulServergetServer()StringgetServerBaseForRequest()Returns the server base URL (with no trailing '/') for a given requestjavax.servlet.http.HttpServletRequestgetServletRequest()javax.servlet.http.HttpServletResponsegetServletResponse()voidsetAttribute(String theAttributeName, Object theAttributeValue)Returns the attribute map for this request.voidsetServer(RestfulServer theServer)voidsetServletRequest(javax.servlet.http.HttpServletRequest myServletRequest)voidsetServletResponse(javax.servlet.http.HttpServletResponse myServletResponse)-
Methods inherited from class ca.uhn.fhir.rest.api.server.RequestDetails
addParameter, getCompartmentName, getCompleteUrl, getConditionalUrl, getFhirServerBase, getFixedConditionalUrl, getId, getInterceptorBroadcaster, getOperation, getParameters, getRequestId, getRequestPath, getRequestStopwatch, getRequestType, getResource, getResourceName, getResponse, getRestOperationType, getSecondaryOperation, getTenantId, getUnqualifiedToQualifiedNames, getUserData, isRespondGzip, isSubRequest, loadRequestContents, removeParameter, setCompartmentName, setCompleteUrl, setFhirServerBase, setFixedConditionalUrl, setId, setOperation, setParameters, setRequestContents, setRequestId, setRequestPath, setRequestType, setResource, setResourceName, setRespondGzip, setResponse, setRestOperationType, setSecondaryOperation, setSubRequest, setTenantId, startDeferredOperationCallback, stopDeferredRequestOperationCallbackAndRunDeferredItems
-
-
-
-
Constructor Detail
-
ServletRequestDetails
public ServletRequestDetails(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
-
-
Method Detail
-
getByteStreamRequestContents
protected byte[] getByteStreamRequestContents()
- Specified by:
getByteStreamRequestContentsin classRequestDetails
-
getCharset
public Charset getCharset()
Description copied from class:RequestDetailsReturn the charset as defined by the header contenttype. Return null if it is not set.- Specified by:
getCharsetin classRequestDetails
-
getFhirContext
public ca.uhn.fhir.context.FhirContext getFhirContext()
Description copied from class:RequestDetailsReturns the HAPI FHIR Context associated with this request- Specified by:
getFhirContextin classRequestDetails
-
getHeader
public String getHeader(String name)
- Specified by:
getHeaderin classRequestDetails
-
getHeaders
public List<String> getHeaders(String name)
- Specified by:
getHeadersin classRequestDetails
-
getAttribute
public Object getAttribute(String theAttributeName)
Description copied from class:RequestDetailsReturns the attribute map for this request. Attributes are a place for user-supplied objects of any type to be attached to an individual request. They can be used to pass information between interceptor methods.- Specified by:
getAttributein classRequestDetails
-
setAttribute
public void setAttribute(String theAttributeName, Object theAttributeValue)
Description copied from class:RequestDetailsReturns the attribute map for this request. Attributes are a place for user-supplied objects of any type to be attached to an individual request. They can be used to pass information between interceptor methods.- Specified by:
setAttributein classRequestDetails
-
getInputStream
public InputStream getInputStream() throws IOException
Description copied from class:RequestDetailsRetrieves the body of the request as binary data. Either this method orRequestDetails.getReader()may be called to read the body, not both.- Specified by:
getInputStreamin classRequestDetails- Returns:
- a
InputStreamobject containing the body of the request - Throws:
IOException- if an input or output exception occurred
-
getReader
public Reader getReader() throws IOException
Description copied from class:RequestDetailsRetrieves the body of the request as character data using aBufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method orRequestDetails.getInputStream()may be called to read the body, not both.- Specified by:
getReaderin classRequestDetails- Returns:
- a
Readercontaining the body of the request - Throws:
UnsupportedEncodingException- if the character set encoding used is not supported and the text cannot be decodedIOException- if an input or output exception occurred- See Also:
ServletRequest.getInputStream()
-
getServer
public RestfulServer getServer()
- Specified by:
getServerin classRequestDetails
-
getServerBaseForRequest
public String getServerBaseForRequest()
Description copied from class:RequestDetailsReturns the server base URL (with no trailing '/') for a given request- Specified by:
getServerBaseForRequestin classRequestDetails
-
getServletRequest
public javax.servlet.http.HttpServletRequest getServletRequest()
-
getServletResponse
public javax.servlet.http.HttpServletResponse getServletResponse()
-
setServer
public void setServer(RestfulServer theServer)
-
setServletRequest
public void setServletRequest(javax.servlet.http.HttpServletRequest myServletRequest)
-
setServletResponse
public void setServletResponse(javax.servlet.http.HttpServletResponse myServletResponse)
-
getHeaders
public Map<String,List<String>> getHeaders()
-
-