public abstract class RequestDetails extends Object
| Constructor and Description |
|---|
RequestDetails(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String theName,
String[] theValues) |
abstract Object |
getAttribute(String theAttributeName)
Returns the attribute map for this request.
|
protected abstract byte[] |
getByteStreamRequestContents() |
abstract Charset |
getCharset()
Return the charset as defined by the header contenttype.
|
String |
getCompartmentName() |
String |
getCompleteUrl() |
String |
getConditionalUrl(ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType)
Returns the conditional URL if this request has one, or
null otherwise. |
abstract ca.uhn.fhir.context.FhirContext |
getFhirContext()
Returns the HAPI FHIR Context associated with this request
|
String |
getFhirServerBase()
The fhir server base url, independant of the query being executed
|
abstract String |
getHeader(String name) |
abstract List<String> |
getHeaders(String name) |
org.hl7.fhir.instance.model.api.IIdType |
getId() |
abstract InputStream |
getInputStream()
Retrieves the body of the request as binary data.
|
ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster |
getInterceptorBroadcaster()
Returns an invoker that can be called from user code to advise the server interceptors
of any nested operations being invoked within operations.
|
String |
getOperation() |
Map<String,String[]> |
getParameters() |
abstract Reader |
getReader()
Retrieves the body of the request as character data using a
BufferedReader. |
String |
getRequestPath()
The part of the request URL that comes after the server base.
|
ca.uhn.fhir.rest.api.RequestTypeEnum |
getRequestType() |
String |
getResourceName() |
IRestfulResponse |
getResponse() |
ca.uhn.fhir.rest.api.RestOperationTypeEnum |
getRestOperationType() |
String |
getSecondaryOperation() |
abstract IRestfulServerDefaults |
getServer() |
abstract String |
getServerBaseForRequest()
Returns the server base URL (with no trailing '/') for a given request
|
String |
getTenantId() |
Map<String,List<String>> |
getUnqualifiedToQualifiedNames() |
Map<Object,Object> |
getUserData()
Returns 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.
|
boolean |
isRespondGzip() |
boolean |
isSubRequest()
Is this request a sub-request (i.e.
|
byte[] |
loadRequestContents() |
void |
removeParameter(String theName) |
abstract void |
setAttribute(String theAttributeName,
Object theAttributeValue)
Returns the attribute map for this request.
|
void |
setCompartmentName(String theCompartmentName) |
void |
setCompleteUrl(String theCompleteUrl) |
void |
setFhirServerBase(String theFhirServerBase) |
void |
setId(org.hl7.fhir.instance.model.api.IIdType theId) |
void |
setOperation(String theOperation) |
void |
setParameters(Map<String,String[]> theParams) |
void |
setRequestContents(byte[] theRequestContents)
This method may be used to modify the contents of the incoming
request by hardcoding a value which will be used instead of the
value received by the client.
|
void |
setRequestPath(String theRequestPath) |
void |
setRequestType(ca.uhn.fhir.rest.api.RequestTypeEnum theRequestType) |
void |
setResourceName(String theResourceName) |
void |
setRespondGzip(boolean theRespondGzip) |
void |
setResponse(IRestfulResponse theResponse) |
void |
setRestOperationType(ca.uhn.fhir.rest.api.RestOperationTypeEnum theRestOperationType) |
void |
setSecondaryOperation(String theSecondaryOperation) |
void |
setSubRequest(boolean theSubRequest)
Is this request a sub-request (i.e.
|
void |
setTenantId(String theTenantId) |
void |
startDeferredOperationCallback()
Sets the
getInterceptorBroadcaster() () interceptor broadcaster} handler in
deferred mode, meaning that any notifications will be queued up for delivery, but
won't be delivered until stopDeferredRequestOperationCallbackAndRunDeferredItems()
is called. |
void |
stopDeferredRequestOperationCallbackAndRunDeferredItems() |
public RequestDetails(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
public void addParameter(String theName, String[] theValues)
protected abstract byte[] getByteStreamRequestContents()
public abstract Charset getCharset()
public String getCompartmentName()
public void setCompartmentName(String theCompartmentName)
public String getCompleteUrl()
public void setCompleteUrl(String theCompleteUrl)
public String getConditionalUrl(ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType)
null otherwise. For an
update or delete method, this is the part of the URL after the ?. For a create, this
is the value of the If-None-Exist header.theOperationType - The operation type to find the conditional URL fornull otherwisepublic abstract ca.uhn.fhir.context.FhirContext getFhirContext()
public String getFhirServerBase()
public void setFhirServerBase(String theFhirServerBase)
public abstract List<String> getHeaders(String name)
public org.hl7.fhir.instance.model.api.IIdType getId()
public void setId(org.hl7.fhir.instance.model.api.IIdType theId)
public abstract Object getAttribute(String theAttributeName)
public abstract void setAttribute(String theAttributeName, Object theAttributeValue)
public abstract InputStream getInputStream() throws IOException
getReader() may be called to read
the body, not both.InputStream object containing the body of the requestIllegalStateException - if the getReader() method has already been called for this requestIOException - if an input or output exception occurredpublic String getOperation()
public void setOperation(String theOperation)
public Map<String,String[]> getParameters()
public void setParameters(Map<String,String[]> theParams)
public abstract Reader getReader() throws IOException
BufferedReader. The reader translates the
character data according to the character encoding used on the body. Either this method or getInputStream()
may be called to read the body, not both.Reader containing the body of the requestUnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decodedIllegalStateException - if getInputStream() method has been called on this requestIOException - if an input or output exception occurredServletRequest.getInputStream()public ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster getInterceptorBroadcaster()
public String getRequestPath()
Will not contain a leading '/'
public void setRequestPath(String theRequestPath)
public ca.uhn.fhir.rest.api.RequestTypeEnum getRequestType()
public void setRequestType(ca.uhn.fhir.rest.api.RequestTypeEnum theRequestType)
public String getResourceName()
public void setResourceName(String theResourceName)
public IRestfulResponse getResponse()
public void setResponse(IRestfulResponse theResponse)
public ca.uhn.fhir.rest.api.RestOperationTypeEnum getRestOperationType()
public void setRestOperationType(ca.uhn.fhir.rest.api.RestOperationTypeEnum theRestOperationType)
public String getSecondaryOperation()
public void setSecondaryOperation(String theSecondaryOperation)
public abstract IRestfulServerDefaults getServer()
public abstract String getServerBaseForRequest()
public String getTenantId()
public void setTenantId(String theTenantId)
public Map<String,List<String>> getUnqualifiedToQualifiedNames()
public Map<Object,Object> getUserData()
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 from an interceptor's IServerInterceptor.incomingRequestPreHandled(RestOperationTypeEnum, ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails)
method to the IServerInterceptor.outgoingResponse(RequestDetails, org.hl7.fhir.instance.model.api.IBaseResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method.
public boolean isRespondGzip()
public void setRespondGzip(boolean theRespondGzip)
public boolean isSubRequest()
Defaults to false
public void setSubRequest(boolean theSubRequest)
Defaults to false
public final byte[] loadRequestContents()
public void removeParameter(String theName)
public void setRequestContents(byte[] theRequestContents)
This method is useful for modifying the request body prior
to parsing within interceptors. It generally only has an
impact when called in the IServerInterceptor.incomingRequestPostProcessed(RequestDetails, HttpServletRequest, HttpServletResponse)
method
public void startDeferredOperationCallback()
getInterceptorBroadcaster() () interceptor broadcaster} handler in
deferred mode, meaning that any notifications will be queued up for delivery, but
won't be delivered until stopDeferredRequestOperationCallbackAndRunDeferredItems()
is called.public void stopDeferredRequestOperationCallbackAndRunDeferredItems()
startDeferredOperationCallback()Copyright © 2014–2019 University Health Network. All rights reserved.