Package ca.uhn.fhir.jaxrs.server
Class AbstractJaxRsConformanceProvider
java.lang.Object
ca.uhn.fhir.jaxrs.server.AbstractJaxRsProvider
ca.uhn.fhir.jaxrs.server.AbstractJaxRsConformanceProvider
- All Implemented Interfaces:
ca.uhn.fhir.rest.server.IResourceProvider
,ca.uhn.fhir.rest.server.IRestfulServerDefaults
@Produces({"application/json","application/xml"})
public abstract class AbstractJaxRsConformanceProvider
extends AbstractJaxRsProvider
implements ca.uhn.fhir.rest.server.IResourceProvider
This is the conformance provider for the jax rs servers. It requires all providers to be registered during startup because the conformance profile is generated during the postconstruct phase.
- Author:
- Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractJaxRsConformanceProvider
(ca.uhn.fhir.context.FhirContext ctx, String implementationDescription, String serverName, String serverVersion) Constructor allowing the description, servername and server to be setprotected
AbstractJaxRsConformanceProvider
(String implementationDescription, String serverName, String serverVersion) Constructor allowing the description, servername and server to be set -
Method Summary
Modifier and TypeMethodDescriptionint
addProvider
(ca.uhn.fhir.rest.server.IResourceProvider theProvider, Class<? extends ca.uhn.fhir.rest.server.IResourceProvider> theProviderInterface) This method will add a provider to the conformance.protected void
This method will set the conformance during the Context Refreshed phase.jakarta.ws.rs.core.Response
This method will retrieve the conformance using the http GET methodjakarta.ws.rs.core.Response
This method will retrieve the conformance using the http OPTIONS methodprotected abstract ConcurrentHashMap
<Class<? extends ca.uhn.fhir.rest.server.IResourceProvider>, ca.uhn.fhir.rest.server.IResourceProvider> This method must return all the resource providers which need to be included in the conformanceClass
<org.hl7.fhir.instance.model.api.IBaseResource> Methods inherited from class ca.uhn.fhir.jaxrs.server.AbstractJaxRsProvider
getAddProfileTag, getBaseForRequest, getBaseForServer, getDefaultResponseEncoding, getElementsSupport, getETagSupport, getFhirContext, getHeaders, getInterceptors_, getInterceptorService, getPagingProvider, getParameters, getRequest, getRequest, getServerAddressStrategy, getUriInfo, handleException, isDefaultPrettyPrint, setHeaders, setUriInfo, withStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.rest.server.IRestfulServerDefaults
getDefaultPageSize, getMaximumPageSize
-
Constructor Details
-
AbstractJaxRsConformanceProvider
protected AbstractJaxRsConformanceProvider(String implementationDescription, String serverName, String serverVersion) Constructor allowing the description, servername and server to be set- Parameters:
implementationDescription
- the implementation description. If null, "" is usedserverName
- the server name. If null, "" is usedserverVersion
- the server version. If null, "" is used
-
AbstractJaxRsConformanceProvider
protected AbstractJaxRsConformanceProvider(ca.uhn.fhir.context.FhirContext ctx, String implementationDescription, String serverName, String serverVersion) Constructor allowing the description, servername and server to be set- Parameters:
ctx
- theFhirContext
instance.implementationDescription
- the implementation description. If null, "" is usedserverName
- the server name. If null, "" is usedserverVersion
- the server version. If null, "" is used
-
-
Method Details
-
buildCapabilityStatement
@EventListener(org.springframework.context.event.ContextRefreshedEvent.class) protected void buildCapabilityStatement()This method will set the conformance during the Context Refreshed phase. The methodgetProviders()
is used to get all the resource providers include in the conformance -
getProviders
protected abstract ConcurrentHashMap<Class<? extends ca.uhn.fhir.rest.server.IResourceProvider>,ca.uhn.fhir.rest.server.IResourceProvider> getProviders()This method must return all the resource providers which need to be included in the conformance- Returns:
- a map of the resource providers and their corresponding classes. This class needs to be given explicitly because retrieving the interface using
Object.getClass()
may not give the correct interface in a jee environment.
-
conformanceUsingOptions
@OPTIONS @Path("/metadata") public jakarta.ws.rs.core.Response conformanceUsingOptions() throws IOExceptionThis method will retrieve the conformance using the http OPTIONS method- Returns:
- the response containing the conformance
- Throws:
IOException
-
conformance
This method will retrieve the conformance using the http GET method- Returns:
- the response containing the conformance
- Throws:
IOException
-
addProvider
public int addProvider(ca.uhn.fhir.rest.server.IResourceProvider theProvider, Class<? extends ca.uhn.fhir.rest.server.IResourceProvider> theProviderInterface) throws ca.uhn.fhir.context.ConfigurationException This method will add a provider to the conformance. This method is almost an exact copy ofRestfulServer.findResourceMethods(Object)
- Parameters:
theProvider
- an instance of the provider interfacetheProviderInterface
- the class describing the providers interface- Returns:
- the numbers of basemethodbindings added
- Throws:
ca.uhn.fhir.context.ConfigurationException
- See Also:
-
getResourceType
- Specified by:
getResourceType
in interfaceca.uhn.fhir.rest.server.IResourceProvider
-