public abstract class RequestDetails extends Object
| Constructor and Description |
|---|
RequestDetails() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract byte[] |
getByteStreamRequestContents() |
abstract Charset |
getCharset()
Return the charset as defined by the header contenttype.
|
String |
getCompartmentName() |
String |
getCompleteUrl() |
String |
getConditionalUrl(RestOperationTypeEnum theOperationType)
Returns the conditional URL if this request has one, or
null otherwise. |
String |
getFhirServerBase()
The fhir server base url, independant of the query being executed
|
abstract String |
getHeader(String name) |
abstract List<String> |
getHeaders(String name) |
IIdType |
getId() |
abstract InputStream |
getInputStream()
Retrieves the body of the request as binary data.
|
String |
getOperation() |
Map<String,String[]> |
getParameters() |
abstract Reader |
getReader()
Retrieves the body of the request as character data using a
BufferedReader. |
IRequestOperationCallback |
getRequestOperationCallback()
Returns an invoker that can be called from user code to advise the server interceptors
of any nested operations being invoked within operations.
|
String |
getRequestPath()
The part of the request URL that comes after the server base.
|
RequestTypeEnum |
getRequestType() |
String |
getResourceName() |
IRestfulResponse |
getResponse() |
RestOperationTypeEnum |
getRestOperationType() |
String |
getSecondaryOperation() |
abstract IRestfulServerDefaults |
getServer() |
abstract String |
getServerBaseForRequest()
Returns the server base URL (with no trailing '/') for a given request
|
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 |
setCompartmentName(String theCompartmentName) |
void |
setCompleteUrl(String theCompleteUrl) |
void |
setFhirServerBase(String theFhirServerBase) |
void |
setId(IIdType theId) |
void |
setOperation(String theOperation) |
void |
setParameters(Map<String,String[]> theParams) |
void |
setRequestPath(String theRequestPath) |
void |
setRequestType(RequestTypeEnum theRequestType) |
void |
setResourceName(String theResourceName) |
void |
setRespondGzip(boolean theRespondGzip) |
void |
setResponse(IRestfulResponse theResponse) |
void |
setRestOperationType(RestOperationTypeEnum theRestOperationType) |
void |
setSecondaryOperation(String theSecondaryOperation) |
void |
setSubRequest(boolean theSubRequest)
Is this request a sub-request (i.e.
|
public RequestDetails()
protected abstract byte[] getByteStreamRequestContents()
public abstract Charset getCharset()
public String getCompartmentName()
public String getCompleteUrl()
public String getConditionalUrl(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 String getFhirServerBase()
public abstract List<String> getHeaders(String name)
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 Map<String,String[]> getParameters()
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 IRequestOperationCallback getRequestOperationCallback()
public String getRequestPath()
Will not contain a leading '/'
public RequestTypeEnum getRequestType()
public String getResourceName()
public IRestfulResponse getResponse()
public RestOperationTypeEnum getRestOperationType()
public String getSecondaryOperation()
public abstract IRestfulServerDefaults getServer()
public abstract String getServerBaseForRequest()
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 boolean isSubRequest()
Defaults to false
public final byte[] loadRequestContents()
public void setCompartmentName(String theCompartmentName)
public void setCompleteUrl(String theCompleteUrl)
public void setFhirServerBase(String theFhirServerBase)
public void setOperation(String theOperation)
public void setParameters(Map<String,String[]> theParams)
public void setRequestPath(String theRequestPath)
public void setRequestType(RequestTypeEnum theRequestType)
public void setResourceName(String theResourceName)
public void setRespondGzip(boolean theRespondGzip)
public void setResponse(IRestfulResponse theResponse)
public void setRestOperationType(RestOperationTypeEnum theRestOperationType)
public void setSecondaryOperation(String theSecondaryOperation)
public void setSubRequest(boolean theSubRequest)
Defaults to false
Copyright © 2014–2017 University Health Network. All rights reserved.