Package ca.uhn.fhir.rest.server.method
Class OperationMethodBinding
- java.lang.Object
-
- ca.uhn.fhir.rest.server.method.BaseMethodBinding<Object>
-
- ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding
-
- ca.uhn.fhir.rest.server.method.OperationMethodBinding
-
- Direct Known Subclasses:
ValidateMethodBindingDstu2Plus
public class OperationMethodBinding extends BaseResourceReturningMethodBinding
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOperationMethodBinding.ReturnType-
Nested classes/interfaces inherited from class ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding
BaseResourceReturningMethodBinding.MethodReturnTypeEnum, BaseResourceReturningMethodBinding.ReturnTypeEnum
-
-
Field Summary
Fields Modifier and Type Field Description static StringWILDCARD_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protectedOperationMethodBinding(Class<?> theReturnResourceType, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theReturnTypeFromRp, Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider, boolean theIdempotent, String theOperationName, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theOperationType, String theOperationTypeName, ca.uhn.fhir.rest.annotation.OperationParam[] theReturnParams, ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType)OperationMethodBinding(Class<?> theReturnResourceType, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theReturnTypeFromRp, Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider, ca.uhn.fhir.rest.annotation.Operation theAnnotation)Constructor - This is the constructor that is called when binding a standard @Operation method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()StringgetName()Returns the name of the operation, starting with "$"protected ca.uhn.fhir.model.valueset.BundleTypeEnumgetResponseBundleType()If the response is a bundle, this type will be placed in the root of the bundle (can be null)ca.uhn.fhir.rest.api.RestOperationTypeEnumgetRestOperationType()ca.uhn.fhir.rest.api.RestOperationTypeEnumgetRestOperationType(RequestDetails theRequestDetails)Determine which operation is being fired for a specific requestList<OperationMethodBinding.ReturnType>getReturnParams()BaseResourceReturningMethodBinding.ReturnTypeEnumgetReturnType()booleanincomingServerRequestMatchesMethod(RequestDetails theRequest)ObjectinvokeServer(IRestfulServer<?> theServer, RequestDetails theRequest)ObjectinvokeServer(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams)booleanisCanOperateAtInstanceLevel()booleanisCanOperateAtServerLevel()booleanisCanOperateAtTypeLevel()booleanisGlobalMethod()Subclasses may override to declare that they apply to all resource typesbooleanisIdempotent()booleanisManualRequestMode()protected voidpopulateActionRequestDetailsForInterceptor(RequestDetails theRequestDetails, IServerInterceptor.ActionRequestDetails theDetails, Object[] theMethodParams)Subclasses may override this method (but should also call super.BaseMethodBinding.populateActionRequestDetailsForInterceptor(RequestDetails, ActionRequestDetails, Object[])to provide method specifics to the interceptors.voidsetDescription(String theDescription)StringtoString()-
Methods inherited from class ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding
callOutgoingFailureOperationOutcomeHook, callOutgoingResponseHook, doInvokeServer, getMethodReturnType, getResourceName, isAddContentLocationHeader, setResourceName
-
Methods inherited from class ca.uhn.fhir.rest.server.method.BaseMethodBinding
bindMethod, createMethodParams, createParametersForServerRequest, getAllowableParamAnnotations, getContext, getIncludes, getMethod, getParameters, getProvider, getRequestIncludesFromParams, invokeServerMethod, isSupportsConditional, isSupportsConditionalMultiple, setParameters, toResourceList, verifyMethodHasZeroOrOneOperationAnnotation
-
-
-
-
Field Detail
-
WILDCARD_NAME
public static final String WILDCARD_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OperationMethodBinding
protected OperationMethodBinding(Class<?> theReturnResourceType, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theReturnTypeFromRp, Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider, boolean theIdempotent, String theOperationName, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theOperationType, String theOperationTypeName, ca.uhn.fhir.rest.annotation.OperationParam[] theReturnParams, ca.uhn.fhir.model.valueset.BundleTypeEnum theBundleType)
-
OperationMethodBinding
public OperationMethodBinding(Class<?> theReturnResourceType, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theReturnTypeFromRp, Method theMethod, ca.uhn.fhir.context.FhirContext theContext, Object theProvider, ca.uhn.fhir.rest.annotation.Operation theAnnotation)
Constructor - This is the constructor that is called when binding a standard @Operation method.
-
-
Method Detail
-
isGlobalMethod
public boolean isGlobalMethod()
Description copied from class:BaseMethodBindingSubclasses may override to declare that they apply to all resource types- Overrides:
isGlobalMethodin classBaseMethodBinding<Object>
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String theDescription)
-
getResponseBundleType
protected ca.uhn.fhir.model.valueset.BundleTypeEnum getResponseBundleType()
Description copied from class:BaseResourceReturningMethodBindingIf the response is a bundle, this type will be placed in the root of the bundle (can be null)- Specified by:
getResponseBundleTypein classBaseResourceReturningMethodBinding
-
getRestOperationType
@Nonnull public ca.uhn.fhir.rest.api.RestOperationTypeEnum getRestOperationType()
- Specified by:
getRestOperationTypein classBaseMethodBinding<Object>
-
getReturnParams
public List<OperationMethodBinding.ReturnType> getReturnParams()
-
getReturnType
public BaseResourceReturningMethodBinding.ReturnTypeEnum getReturnType()
- Specified by:
getReturnTypein classBaseResourceReturningMethodBinding
-
incomingServerRequestMatchesMethod
public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest)
- Specified by:
incomingServerRequestMatchesMethodin classBaseMethodBinding<Object>
-
getRestOperationType
public ca.uhn.fhir.rest.api.RestOperationTypeEnum getRestOperationType(RequestDetails theRequestDetails)
Description copied from class:BaseMethodBindingDetermine which operation is being fired for a specific request- Overrides:
getRestOperationTypein classBaseMethodBinding<Object>- Parameters:
theRequestDetails- The request
-
invokeServer
public Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) throws ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException, IOException
- Overrides:
invokeServerin classBaseResourceReturningMethodBinding- Throws:
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseExceptionIOException
-
invokeServer
public Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest, Object[] theMethodParams) throws ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException
- Specified by:
invokeServerin classBaseResourceReturningMethodBinding- Throws:
ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException
-
isCanOperateAtInstanceLevel
public boolean isCanOperateAtInstanceLevel()
-
isCanOperateAtServerLevel
public boolean isCanOperateAtServerLevel()
-
isCanOperateAtTypeLevel
public boolean isCanOperateAtTypeLevel()
-
isIdempotent
public boolean isIdempotent()
-
populateActionRequestDetailsForInterceptor
protected void populateActionRequestDetailsForInterceptor(RequestDetails theRequestDetails, IServerInterceptor.ActionRequestDetails theDetails, Object[] theMethodParams)
Description copied from class:BaseMethodBindingSubclasses may override this method (but should also call super.BaseMethodBinding.populateActionRequestDetailsForInterceptor(RequestDetails, ActionRequestDetails, Object[])to provide method specifics to the interceptors.- Overrides:
populateActionRequestDetailsForInterceptorin classBaseMethodBinding<Object>- Parameters:
theRequestDetails- The server request detailstheDetails- The details object to populatetheMethodParams- The method params as generated by the specific method binding
-
isManualRequestMode
public boolean isManualRequestMode()
-
-