public class RestfulServerUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RestfulServerUtils.ResponseEncoding
Return type for
determineRequestEncodingNoDefault(RequestDetails) |
| Constructor and Description |
|---|
RestfulServerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAcceptHeaderToRequest(EncodingEnum theEncoding,
IHttpRequest theHttpRequest,
FhirContext theContext) |
static void |
configureResponseParser(RequestDetails theRequestDetails,
IParser parser) |
static String |
createPagingLink(Set<Include> theIncludes,
String theServerBase,
String theSearchId,
int theOffset,
int theCount,
EncodingEnum theResponseEncoding,
boolean thePrettyPrint,
BundleTypeEnum theBundleType) |
static EncodingEnum |
determineRequestEncoding(RequestDetails theReq) |
static EncodingEnum |
determineRequestEncodingNoDefault(RequestDetails theReq) |
static RestfulServerUtils.ResponseEncoding |
determineResponseEncodingNoDefault(RequestDetails theReq,
EncodingEnum thePrefer)
Returns null if the request doesn't express that it wants FHIR.
|
static RestfulServerUtils.ResponseEncoding |
determineResponseEncodingWithDefault(RequestDetails theReq)
Determine whether a response should be given in JSON or XML format based on the incoming HttpServletRequest's
"_format" parameter and "Accept:" HTTP header. |
static Set<SummaryEnum> |
determineSummaryMode(RequestDetails theRequest) |
static Integer |
extractCountParameter(RequestDetails theRequest) |
static IPrimitiveType<Date> |
extractLastUpdatedFromResource(IBaseResource theResource) |
static IIdType |
fullyQualifyResourceIdOrReturnNull(IRestfulServerDefaults theServer,
IBaseResource theResource,
String theServerBase,
IIdType theResourceId) |
static IParser |
getNewParser(FhirContext theContext,
RequestDetails theRequestDetails) |
static Set<String> |
parseAcceptHeaderAndReturnHighestRankedOptions(javax.servlet.http.HttpServletRequest theRequest) |
static PreferReturnEnum |
parsePreferHeader(String theValue) |
static boolean |
prettyPrintResponse(IRestfulServerDefaults theServer,
RequestDetails theRequest) |
static Object |
streamResponseAsBundle(IRestfulServerDefaults theServer,
Bundle bundle,
Set<SummaryEnum> theSummaryMode,
boolean respondGzip,
RequestDetails theRequestDetails) |
static Object |
streamResponseAsResource(IRestfulServerDefaults theServer,
IBaseResource theResource,
Set<SummaryEnum> theSummaryMode,
int stausCode,
boolean theAddContentLocationHeader,
boolean respondGzip,
RequestDetails theRequestDetails) |
static Object |
streamResponseAsResource(IRestfulServerDefaults theServer,
IBaseResource theResource,
Set<SummaryEnum> theSummaryMode,
int theStausCode,
String theStatusMessage,
boolean theAddContentLocationHeader,
boolean respondGzip,
RequestDetails theRequestDetails,
IIdType theOperationResourceId,
IPrimitiveType<Date> theOperationResourceLastUpdated) |
static Integer |
tryToExtractNamedParameter(RequestDetails theRequest,
String theParamName) |
static void |
validateResourceListNotNull(List<? extends IBaseResource> theResourceList) |
public RestfulServerUtils()
public static void configureResponseParser(RequestDetails theRequestDetails, IParser parser)
public static String createPagingLink(Set<Include> theIncludes, String theServerBase, String theSearchId, int theOffset, int theCount, EncodingEnum theResponseEncoding, boolean thePrettyPrint, BundleTypeEnum theBundleType)
public static EncodingEnum determineRequestEncoding(RequestDetails theReq)
public static EncodingEnum determineRequestEncodingNoDefault(RequestDetails theReq)
public static RestfulServerUtils.ResponseEncoding determineResponseEncodingNoDefault(RequestDetails theReq, EncodingEnum thePrefer)
public static RestfulServerUtils.ResponseEncoding determineResponseEncodingWithDefault(RequestDetails theReq)
"_format" parameter and "Accept:" HTTP header.public static Set<SummaryEnum> determineSummaryMode(RequestDetails theRequest)
public static Integer extractCountParameter(RequestDetails theRequest)
public static IPrimitiveType<Date> extractLastUpdatedFromResource(IBaseResource theResource)
public static IIdType fullyQualifyResourceIdOrReturnNull(IRestfulServerDefaults theServer, IBaseResource theResource, String theServerBase, IIdType theResourceId)
public static IParser getNewParser(FhirContext theContext, RequestDetails theRequestDetails)
public static Set<String> parseAcceptHeaderAndReturnHighestRankedOptions(javax.servlet.http.HttpServletRequest theRequest)
public static PreferReturnEnum parsePreferHeader(String theValue)
public static boolean prettyPrintResponse(IRestfulServerDefaults theServer, RequestDetails theRequest)
public static Object streamResponseAsBundle(IRestfulServerDefaults theServer, Bundle bundle, Set<SummaryEnum> theSummaryMode, boolean respondGzip, RequestDetails theRequestDetails) throws IOException
IOExceptionpublic static Object streamResponseAsResource(IRestfulServerDefaults theServer, IBaseResource theResource, Set<SummaryEnum> theSummaryMode, int stausCode, boolean theAddContentLocationHeader, boolean respondGzip, RequestDetails theRequestDetails) throws IOException
IOExceptionpublic static Object streamResponseAsResource(IRestfulServerDefaults theServer, IBaseResource theResource, Set<SummaryEnum> theSummaryMode, int theStausCode, String theStatusMessage, boolean theAddContentLocationHeader, boolean respondGzip, RequestDetails theRequestDetails, IIdType theOperationResourceId, IPrimitiveType<Date> theOperationResourceLastUpdated) throws IOException
IOExceptionpublic static Integer tryToExtractNamedParameter(RequestDetails theRequest, String theParamName)
public static void validateResourceListNotNull(List<? extends IBaseResource> theResourceList)
public static void addAcceptHeaderToRequest(EncodingEnum theEncoding, IHttpRequest theHttpRequest, FhirContext theContext)
Copyright © 2014–2017 University Health Network. All rights reserved.