public class ApacheHttpclientDocumentServerClient extends AbstractDocumentServerClient
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ApacheHttpclientDocumentServerClient.Callback<Result> |
| Modifier and Type | Field and Description |
|---|---|
private String |
baseUrl
Base URL for document server API endpoints.
|
private org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
httpClient
HttpClient. |
private org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
httpClientForSyncConvertRequest
HttpClient. |
private boolean |
isIgnoreSSLCertificate
Flag indicating whether to ignore SSL certificate validation.
|
private com.fasterxml.jackson.databind.ObjectMapper |
objectMapper
ObjectMapper. |
documentServerClientSettings, settingsManager, urlManager| Constructor and Description |
|---|
ApacheHttpclientDocumentServerClient(DocumentServerClientSettings documentServerClientSettings)
Constructs ApacheHttpclientDocumentServerClient with document server client settings.
|
ApacheHttpclientDocumentServerClient(SettingsManager settingsManager,
UrlManager urlManager)
Constructs ApacheHttpclientDocumentServerClient with required managers.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
authorizeRequest(org.apache.hc.core5.http.ClassicHttpRequest request,
RequestEntity requestEntity)
Authorizes a request by adding a JWT header if security key is configured.
|
CommandResponse |
command(CommandRequest commandRequest)
Executes a command on the document server.
|
ConvertResponse |
convert(ConvertRequest convertRequest)
Converts a document according to the specified conversion parameters.
|
protected org.apache.hc.core5.http.HttpEntity |
createEntity(RequestEntity requestEntity)
Creates an HTTP entity from the request entity, generating auth token if needed.
|
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
createHttpClient(HttpClientProperties httpClientProperties) |
DocBuilderResponse |
docbuilder(DocBuilderRequest docBuilderRequest)
Executes a DocBuilder request to perform document processing operations.
|
protected <T> T |
executeRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
Class<T> valueType) |
protected int |
executeRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
OutputStream outputStream) |
protected <R> R |
executeRequest(org.apache.hc.client5.http.classic.HttpClient httpClient,
org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
ApacheHttpclientDocumentServerClient.Callback<R> callback) |
protected <T> T |
executeRequestWithHttpClientForSyncConvertRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
Class<T> valueType) |
byte[] |
getFile(String fileUrl)
Retrieves a file from the specified path as a byte array.
|
int |
getFile(String fileUrl,
OutputStream outputStream)
Retrieves a file from the specified path and writes it to the provided output stream.
|
protected Long |
getSyncSocketTimeoutForConvertService() |
Boolean |
healthcheck()
Performs a health check of the document server.
|
protected void |
init() |
protected void |
prepareHttpClient() |
protected boolean |
shouldReinit() |
applySettings, applySettings, getBaseUrl, getHttpClientProperties, getSecurityHeader, getSecurityKey, getSecurityPrefix, isSecurityEnabledprivate org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient
HttpClient.private org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClientForSyncConvertRequest
HttpClient.private String baseUrl
private boolean isIgnoreSSLCertificate
private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
ObjectMapper.public ApacheHttpclientDocumentServerClient(DocumentServerClientSettings documentServerClientSettings)
documentServerClientSettings - the settings for the document server clientpublic ApacheHttpclientDocumentServerClient(SettingsManager settingsManager, UrlManager urlManager)
settingsManager - the settings manager for managing configurationurlManager - the URL manager for handling document server URLspublic Boolean healthcheck()
DocumentServerClientpublic byte[] getFile(String fileUrl)
DocumentServerClientfileUrl - The fileUrl to the file to be retrievedpublic int getFile(String fileUrl, OutputStream outputStream)
DocumentServerClientfileUrl - The fileUrl to the file to be retrievedoutputStream - The output stream to write the file contents topublic ConvertResponse convert(ConvertRequest convertRequest)
DocumentServerClientconvertRequest - The conversion request containing parameters and settingspublic CommandResponse command(CommandRequest commandRequest)
DocumentServerClientcommandRequest - The command request containing the command and parameterspublic DocBuilderResponse docbuilder(DocBuilderRequest docBuilderRequest)
DocumentServerClientdocBuilderRequest - The request containing DocBuilder instructions and parametersprotected <T> T executeRequestWithHttpClientForSyncConvertRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
Class<T> valueType)
protected <T> T executeRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
Class<T> valueType)
protected int executeRequest(org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
OutputStream outputStream)
protected <R> R executeRequest(org.apache.hc.client5.http.classic.HttpClient httpClient,
org.apache.hc.core5.http.ClassicHttpRequest classicHttpRequest,
ApacheHttpclientDocumentServerClient.Callback<R> callback)
protected void authorizeRequest(org.apache.hc.core5.http.ClassicHttpRequest request,
RequestEntity requestEntity)
request - the HTTP request to authorizerequestEntity - the request entity containing data for authorizationprotected org.apache.hc.core5.http.HttpEntity createEntity(RequestEntity requestEntity)
requestEntity - the request entity to convertprotected void prepareHttpClient()
protected boolean shouldReinit()
protected void init()
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient createHttpClient(HttpClientProperties httpClientProperties)
protected Long getSyncSocketTimeoutForConvertService()
Copyright © 2023–2025. All rights reserved.