@Override public String determineServerBase(ServletContext theServletContext, HttpServletRequest theRequest) { String forwardedHost = getForwardedHost(theRequest); if (forwardedHost != null) { return forwardedServerBase(theServletContext, theRequest, forwardedHost); } return super.determineServerBase(theServletContext, theRequest); }
public static EncodingEnum determineRequestEncodingNoDefault(RequestDetails theReq) { ResponseEncoding retVal = determineRequestEncodingNoDefaultReturnRE(theReq); if (retVal == null) { return null; } return retVal.getEncoding(); }
/** * Static factory for instance using <code>https://</code> */ public static ApacheProxyAddressStrategy forHttps() { return new ApacheProxyAddressStrategy(true); } }
/** * Returns the method bindings for this server which are not specific to any particular resource type. This method is * internal to HAPI and developers generally do not need to interact with it. Use * with caution, as it may change. */ public List<BaseMethodBinding<?>> getServerBindings() { return myServerBinding.getMethodBindings(); }
private String getServerBase(ServletRequestDetails theHttpRequest) { return myRestfulServer.getServerBaseForRequest(theHttpRequest); } }
public static IBundleProvider newList(List<IBaseResource> theResources) { return new SimpleBundleProvider(theResources); } }
/** * Determine whether a response should be given in JSON or XML format based on the incoming HttpServletRequest's * <code>"_format"</code> parameter and <code>"Accept:"</code> HTTP header. */ public static ResponseEncoding determineResponseEncodingWithDefault(RequestDetails theReq) { ResponseEncoding retVal = determineResponseEncodingNoDefault(theReq, theReq.getServer().getDefaultResponseEncoding()); if (retVal == null) { retVal = new ResponseEncoding(theReq.getServer().getFhirContext(), theReq.getServer().getDefaultResponseEncoding(), null); } return retVal; }
public static String createPagingLink(Set<Include> theIncludes, String theServerBase, String theSearchId, int theOffset, int theCount, Map<String, String[]> theRequestParameters, boolean thePrettyPrint, BundleTypeEnum theBundleType) { return createPagingLink(theIncludes, theServerBase, theSearchId, theOffset, theCount, theRequestParameters, thePrettyPrint, theBundleType, null); }
@Override public void customize(RestfulServer server) { server.setPlainProviders(systemProviders); } }
@Override public final Object streamResponseAsResource(IBaseResource theResource, boolean thePrettyPrint, Set<SummaryEnum> theSummaryMode, int theStatusCode, String theStatusMessage, boolean theRespondGzip, boolean theAddContentLocation) throws IOException { return RestfulServerUtils.streamResponseAsResource(theRequestDetails.getServer(), theResource, theSummaryMode, theStatusCode, theStatusMessage, theAddContentLocation, theRespondGzip, getRequestDetails(), myOperationResourceId, myOperationResourceLastUpdated); }
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(RequestTypeEnum.GET, request, response); }
@Override public BundleProviderWithNamedPages setSize(Integer theSize) { super.setSize(theSize); return this; }
/** * @TODO: this method is only called from one place and should be removed anyway */ public static EncodingEnum determineRequestEncoding(RequestDetails theReq) { EncodingEnum retVal = determineRequestEncodingNoDefault(theReq); if (retVal != null) { return retVal; } return EncodingEnum.XML; }
/** * Returns null if the request doesn't express that it wants FHIR. If it expresses that it wants XML and JSON * equally, returns thePrefer. */ public static ResponseEncoding determineResponseEncodingNoDefault(RequestDetails theReq, EncodingEnum thePrefer) { return determineResponseEncodingNoDefault(theReq, thePrefer, null); }
public static Object streamResponseAsResource(IRestfulServerDefaults theServer, IBaseResource theResource, Set<SummaryEnum> theSummaryMode, int stausCode, boolean theAddContentLocationHeader, boolean respondGzip, RequestDetails theRequestDetails) throws IOException { return streamResponseAsResource(theServer, theResource, theSummaryMode, stausCode, null, theAddContentLocationHeader, respondGzip, theRequestDetails, null, null); }
@Override public List<IBaseResource> getResources(int theFromIndex, int theToIndex) { return getList(); // indexes are ignored for this provider type }
private String getServerBase(ServletRequestDetails theHttpRequest) { return myRestfulServer.getServerBaseForRequest(theHttpRequest); } }
public static String createPagingLink(Set<Include> theIncludes, String theServerBase, String theSearchId, String thePageId, Map<String, String[]> theRequestParameters, boolean thePrettyPrint, BundleTypeEnum theBundleType) { return createPagingLink(theIncludes, theServerBase, theSearchId, null, null, theRequestParameters, thePrettyPrint, theBundleType, thePageId); }
/** * Static factory for instance using <code>http://</code> */ public static ApacheProxyAddressStrategy forHttp() { return new ApacheProxyAddressStrategy(false); }
@Override protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(RequestTypeEnum.DELETE, request, response); }