/** * Provides the ability to set the {@link FhirContext} instance. * @param ctx the {@link FhirContext} instance. */ protected AbstractJaxRsPageProvider(FhirContext ctx) { super(ctx); try { myBinding = new PageMethodBinding(getFhirContext(), PageProvider.class.getMethod("getPage")); } catch (Exception e) { throw new ca.uhn.fhir.context.ConfigurationException(e); } }
private void validateHaveBundleProvider(String thePagingAction, IBundleProvider theBundleProvider) { // Return an HTTP 410 if the search is not known if (theBundleProvider == null) { ourLog.info("Client requested unknown paging ID[{}]", thePagingAction); String msg = getContext().getLocalizer().getMessage(PageMethodBinding.class, "unknownSearchId", thePagingAction); throw new ResourceGoneException(msg); } }
@Override public IBaseResource doInvokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) { return handlePagingRequest(theServer, theRequest, theRequest.getParameters().get(Constants.PARAM_PAGINGACTION)[0]); }
validateHaveBundleProvider(thePagingAction, resultList); validateHaveBundleProvider(thePagingAction, resultList); return createBundleFromBundleProvider(theServer, theRequest, count, linkSelf, includes, resultList, start, bundleType, encodingEnum, thePagingAction);
/** * This method implements the "getpages" action */ @GET public Response getPages(@QueryParam(Constants.PARAM_PAGINGACTION) String thePageId) throws IOException { JaxRsRequest theRequest = getRequest(RequestTypeEnum.GET, RestOperationTypeEnum.GET_PAGE).build(); try { return (Response) myBinding.invokeServer(this, theRequest); } catch (JaxRsResponseException theException) { return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest, theException); } }
validateHaveBundleProvider(thePagingAction, resultList); validateHaveBundleProvider(thePagingAction, resultList); return createBundleFromBundleProvider(theServer, theRequest, count, linkSelf, includes, resultList, start, bundleType, encodingEnum, thePagingAction);
/** * The default constructor. */ protected AbstractJaxRsPageProvider() { try { myBinding = new PageMethodBinding(getFhirContext(), PageProvider.class.getMethod("getPage")); } catch (Exception e) { throw new ca.uhn.fhir.context.ConfigurationException(e); } }
@Override public Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams) throws InvalidRequestException, InternalErrorException { return handlePagingRequest(theServer, theRequest, theRequest.getParameters().get(Constants.PARAM_PAGINGACTION)[0]); }
private void validateHaveBundleProvider(String thePagingAction, IBundleProvider theBundleProvider) { // Return an HTTP 410 if the search is not known if (theBundleProvider == null) { ourLog.info("Client requested unknown paging ID[{}]", thePagingAction); String msg = getContext().getLocalizer().getMessage(PageMethodBinding.class, "unknownSearchId", thePagingAction); throw new ResourceGoneException(msg); } }
return new PageMethodBinding(theContext, theMethod);
@Override public Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams) throws InvalidRequestException, InternalErrorException { return handlePagingRequest(theServer, theRequest, theRequest.getParameters().get(Constants.PARAM_PAGINGACTION)[0]); }
return new PageMethodBinding(theContext, theMethod);
@Override public IBaseResource doInvokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) { return handlePagingRequest(theServer, theRequest, theRequest.getParameters().get(Constants.PARAM_PAGINGACTION)[0]); }