public class RestfulServerUtils extends Object
| Constructor and Description |
|---|
RestfulServerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addProfileToBundleEntry(FhirContext theContext,
IBaseResource theResource,
String theServerBase) |
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 EncodingEnum |
determineResponseEncodingNoDefault(RequestDetails theReq,
EncodingEnum thePrefer)
Returns null if the request doesn't express that it wants FHIR.
|
static EncodingEnum |
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 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 Integer |
tryToExtractNamedParameter(RequestDetails theRequest,
String theParamName) |
static void |
validateResourceListNotNull(List<? extends IBaseResource> theResourceList) |
public RestfulServerUtils()
public static void addProfileToBundleEntry(FhirContext theContext, IBaseResource theResource, String theServerBase)
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 EncodingEnum determineResponseEncodingNoDefault(RequestDetails theReq, EncodingEnum thePrefer)
public static EncodingEnum determineResponseEncodingWithDefault(RequestDetails theReq)
"_format" parameter and "Accept:" HTTP header.public static Set<SummaryEnum> determineSummaryMode(RequestDetails theRequest)
public static Integer extractCountParameter(RequestDetails theRequest)
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 void validateResourceListNotNull(List<? extends IBaseResource> theResourceList)
public static Integer tryToExtractNamedParameter(RequestDetails theRequest, String theParamName)
Copyright © 2014–2016 University Health Network. All rights reserved.