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
ConstructorDescriptionBaseMethodBinding
(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider) -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseMethodBinding
bindMethod
(Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider) void
close()
protected Object[]
createMethodParams
(RequestDetails theRequest) protected Object[]
createParametersForServerRequest
(RequestDetails theRequest) ca.uhn.fhir.context.FhirContext
protected List
<BaseQueryParameter> Set
<ca.uhn.fhir.model.api.Include> getRequestIncludesFromParams
(Object[] params) abstract String
Returns the name of the resource this method handles, ornull
if this method is not resource specificabstract ca.uhn.fhir.rest.api.RestOperationTypeEnum
ca.uhn.fhir.rest.api.RestOperationTypeEnum
getRestOperationType
(RequestDetails theRequestDetails) Determine which operation is being fired for a specific requestabstract MethodMatchEnum
incomingServerRequestMatchesMethod
(RequestDetails theRequest) abstract Object
invokeServer
(IRestfulServer<?> theServer, RequestDetails theRequest) protected final Object
invokeServerMethod
(RequestDetails theRequest, Object[] theMethodParams) boolean
Subclasses may override to declare that they apply to all resource typesboolean
Does this method have a parameter annotated withConditionalParamBinder
.boolean
Does this method support conditional operations over multiple objects (basically for conditional delete)protected void
populateRequestDetailsForInterceptor
(RequestDetails theRequestDetails, Object[] theMethodParams) Subclasses may override this method (but should also call super) to provide method specifics to the interceptors.void
setParameters
(List<IParameter> theParameters) For unit tests onlyprotected IBundleProvider
toResourceList
(Object response) static boolean
verifyMethodHasZeroOrOneOperationAnnotation
(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, ornull
if 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.BaseServerResponseException
IOException
-
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)
-