Class DefaultRestClient
- java.lang.Object
-
- org.ehrbase.client.openehrclient.defaultrestclient.DefaultRestClient
-
- All Implemented Interfaces:
OpenEhrClient
public class DefaultRestClient extends Object implements OpenEhrClient
-
-
Constructor Summary
Constructors Constructor Description DefaultRestClient(OpenEhrClientConfig config)DefaultRestClient(OpenEhrClientConfig config, TemplateProvider templateProvider)DefaultRestClient(OpenEhrClientConfig config, TemplateProvider templateProvider, org.apache.http.client.HttpClient httpClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminEhrEndpointadminEhrEndpoint()Get theAdminEhrEndpointAdminTemplateEndpointadminTemplateEndpoint()AqlEndpointaqlEndpoint()Get theAqlEndpointCompositionEndpointcompositionEndpoint(UUID ehrId)Get theCompositionEndpointfor ehr with IdehrIdContributionEndpointcontributionEndpoint(UUID ehrId)Get theContributionEndpointfor ehr with IdehrIdDefaultRestEhrEndpointehrEndpoint()Get theEhrEndpointFolderDAOfolder(UUID ehrId, String path)protected OpenEhrClientConfiggetConfig()protected DefaultValuesProvidergetDefaultValuesProvider()org.apache.http.client.fluent.ExecutorgetExecutor()protected <T> Optional<T>httpGet(URI uri, Class<T> valueType)protected <T> Optional<T>httpGet(URI uri, Class<T> valueType, Map<String,String> headers)protected VersionUidhttpPost(URI uri, com.nedap.archie.rm.RMObject body)protected VersionUidhttpPost(URI uri, com.nedap.archie.rm.RMObject body, Map<String,String> headers)protected VersionUidhttpPut(URI uri, com.nedap.archie.rm.archetyped.Locatable body, VersionUid versionUid)protected VersionUidhttpPut(URI uri, com.nedap.archie.rm.archetyped.Locatable body, VersionUid versionUid, Map<String,String> headers)protected org.apache.http.HttpResponseinternalDelete(URI uri, Map<String,String> headers)used with the admin endpoint for nowprotected org.apache.http.HttpResponseinternalGet(URI uri, Map<String,String> headers, String accept)protected org.apache.http.HttpResponseinternalPost(URI uri, Map<String,String> headers, String bodyString, org.apache.http.entity.ContentType contentType, String accept)protected org.apache.http.HttpResponseinternalPut(URI uri, Map<String,String> headers, String bodyString, org.apache.http.entity.ContentType contentType, String accept)TemplateEndpointtemplateEndpoint()Get theTemplateEndpointVersionedCompositionEndpointversionedCompositionEndpoint(UUID ehrId)Get theVersionedCompositionEndpoint.
-
-
-
Constructor Detail
-
DefaultRestClient
public DefaultRestClient(OpenEhrClientConfig config, TemplateProvider templateProvider)
-
DefaultRestClient
public DefaultRestClient(OpenEhrClientConfig config)
-
DefaultRestClient
public DefaultRestClient(OpenEhrClientConfig config, TemplateProvider templateProvider, org.apache.http.client.HttpClient httpClient)
-
-
Method Detail
-
httpPost
protected VersionUid httpPost(URI uri, com.nedap.archie.rm.RMObject body)
-
httpPost
protected VersionUid httpPost(URI uri, com.nedap.archie.rm.RMObject body, Map<String,String> headers)
-
internalPost
protected org.apache.http.HttpResponse internalPost(URI uri, Map<String,String> headers, String bodyString, org.apache.http.entity.ContentType contentType, String accept)
-
internalPut
protected org.apache.http.HttpResponse internalPut(URI uri, Map<String,String> headers, String bodyString, org.apache.http.entity.ContentType contentType, String accept)
-
httpPut
protected VersionUid httpPut(URI uri, com.nedap.archie.rm.archetyped.Locatable body, VersionUid versionUid)
-
httpPut
protected VersionUid httpPut(URI uri, com.nedap.archie.rm.archetyped.Locatable body, VersionUid versionUid, Map<String,String> headers)
-
httpGet
protected <T> Optional<T> httpGet(URI uri, Class<T> valueType, Map<String,String> headers)
-
internalGet
protected org.apache.http.HttpResponse internalGet(URI uri, Map<String,String> headers, String accept)
-
internalDelete
protected org.apache.http.HttpResponse internalDelete(URI uri, Map<String,String> headers)
used with the admin endpoint for now- Parameters:
uri-headers-- Returns:
-
getConfig
protected OpenEhrClientConfig getConfig()
-
getDefaultValuesProvider
protected DefaultValuesProvider getDefaultValuesProvider()
-
getExecutor
public org.apache.http.client.fluent.Executor getExecutor()
-
ehrEndpoint
public DefaultRestEhrEndpoint ehrEndpoint()
Description copied from interface:OpenEhrClientGet theEhrEndpoint- Specified by:
ehrEndpointin interfaceOpenEhrClient- Returns:
-
compositionEndpoint
public CompositionEndpoint compositionEndpoint(UUID ehrId)
Description copied from interface:OpenEhrClientGet theCompositionEndpointfor ehr with IdehrId- Specified by:
compositionEndpointin interfaceOpenEhrClient- Parameters:
ehrId- ehrId of ehr for which to revive compositions- Returns:
-
contributionEndpoint
public ContributionEndpoint contributionEndpoint(UUID ehrId)
Description copied from interface:OpenEhrClientGet theContributionEndpointfor ehr with IdehrId- Specified by:
contributionEndpointin interfaceOpenEhrClient- Parameters:
ehrId- ehrId of ehr for which to revive contributions- Returns:
-
folder
public FolderDAO folder(UUID ehrId, String path)
- Specified by:
folderin interfaceOpenEhrClient
-
templateEndpoint
public TemplateEndpoint templateEndpoint()
Description copied from interface:OpenEhrClientGet theTemplateEndpoint- Specified by:
templateEndpointin interfaceOpenEhrClient- Returns:
-
aqlEndpoint
public AqlEndpoint aqlEndpoint()
Description copied from interface:OpenEhrClientGet theAqlEndpoint- Specified by:
aqlEndpointin interfaceOpenEhrClient- Returns:
-
adminEhrEndpoint
public AdminEhrEndpoint adminEhrEndpoint()
Description copied from interface:OpenEhrClientGet theAdminEhrEndpoint- Specified by:
adminEhrEndpointin interfaceOpenEhrClient- Returns:
-
adminTemplateEndpoint
public AdminTemplateEndpoint adminTemplateEndpoint()
- Specified by:
adminTemplateEndpointin interfaceOpenEhrClient
-
versionedCompositionEndpoint
public VersionedCompositionEndpoint versionedCompositionEndpoint(UUID ehrId)
Description copied from interface:OpenEhrClientGet theVersionedCompositionEndpoint.- Specified by:
versionedCompositionEndpointin interfaceOpenEhrClient- Parameters:
ehrId- the EHR identifier- Returns:
- the endpoint
-
-