
Package ca.uhn.fhir.rest.server.method
Class BaseMethodBinding
java.lang.Object
ca.uhn.fhir.rest.server.method.BaseMethodBinding
- Direct Known Subclasses:
BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody,BaseResourceReturningMethodBinding,CreateMethodBinding,UpdateMethodBinding
-
Constructor Summary
ConstructorsConstructorDescriptionBaseMethodBinding(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseMethodBindingbindMethod(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider) voidclose()protected Object[]createMethodParams(RequestDetails theRequest) protected Object[]createParametersForServerRequest(RequestDetails theRequest) ca.uhn.fhir.context.FhirContextprotected List<BaseQueryParameter> Set<ca.uhn.fhir.model.api.Include> getRequestIncludesFromParams(Object[] params) abstract StringReturns the name of the resource this method handles, ornullif this method is not resource specificabstract ca.uhn.fhir.rest.api.RestOperationTypeEnumca.uhn.fhir.rest.api.RestOperationTypeEnumgetRestOperationType(RequestDetails theRequestDetails) Determine which operation is being fired for a specific requestabstract MethodMatchEnumincomingServerRequestMatchesMethod(RequestDetails theRequest) abstract ObjectinvokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) protected final ObjectinvokeServerMethod(RequestDetails theRequest, Object[] theMethodParams) booleanSubclasses may override to declare that they apply to all resource typesbooleanDoes this method have a parameter annotated withConditionalParamBinder.booleanDoes this method support conditional operations over multiple objects (basically for conditional delete)protected voidpopulateRequestDetailsForInterceptor(RequestDetails theRequestDetails, Object[] theMethodParams) Subclasses may override this method (but should also call super) to provide method specifics to the interceptors.voidsetParameters(List<IParameter> theParameters) For unit tests onlyprotected IBundleProvidertoResourceList(Object response) static booleanverifyMethodHasZeroOrOneOperationAnnotation(Method theNextMethod, Object... theAnnotations)
-
Constructor Details
-
BaseMethodBinding
public BaseMethodBinding(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider)
-
-
Method Details
-
getQueryParameters
-
createMethodParams
-
createParametersForServerRequest
-
isGlobalMethod
Subclasses may override to declare that they apply to all resource types -
getAllowableParamAnnotations
-
getContext
-
getIncludes
-
getRevIncludes
-
getMethod
-
getParameters
-
setParameters
For unit tests only -
getProvider
-
getRequestIncludesFromParams
-
getResourceName
Returns the name of the resource this method handles, ornullif this method is not resource specific -
getRestOperationType
-
getRestOperationType
public ca.uhn.fhir.rest.api.RestOperationTypeEnum getRestOperationType(RequestDetails theRequestDetails) Determine which operation is being fired for a specific request- Parameters:
theRequestDetails- The request
-
incomingServerRequestMatchesMethod
-
invokeServer
public abstract Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) throws ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException, IOException - Throws:
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseExceptionIOException
-
invokeServerMethod
-
isSupportsConditional
Does this method have a parameter annotated withConditionalParamBinder. Note that many operations don't actually support this paramter, so this will only return true occasionally. -
isSupportsConditionalMultiple
Does this method support conditional operations over multiple objects (basically for conditional delete) -
populateRequestDetailsForInterceptor
protected void populateRequestDetailsForInterceptor(RequestDetails theRequestDetails, Object[] theMethodParams) Subclasses may override this method (but should also call super) to provide method specifics to the interceptors.- Parameters:
theRequestDetails- The server request detailstheMethodParams- The method params as generated by the specific method binding
-
toResourceList
protected IBundleProvider toResourceList(Object response) throws ca.uhn.fhir.rest.server.exceptions.InternalErrorException - Throws:
ca.uhn.fhir.rest.server.exceptions.InternalErrorException
-
close
-
bindMethod
public static BaseMethodBinding bindMethod(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider) -
verifyMethodHasZeroOrOneOperationAnnotation
public static boolean verifyMethodHasZeroOrOneOperationAnnotation(Method theNextMethod, Object... theAnnotations)
-