Class JaxRsAdapterRestEasy
java.lang.Object
de.xima.fc.api.rest.pub.client.form.JaxRsAdapterRestEasy
- All Implemented Interfaces:
JaxRsAdapter
@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator")
public class JaxRsAdapterRestEasy
extends Object
implements JaxRsAdapter
Adapter for the API client that integrates with a Jax RS implementation. You can extend
this class and override methods you want to customize.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Function<? super org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder, ? extends javax.ws.rs.client.Client> protected final org.jboss.resteasy.client.jaxrs.ClientHttpEngineprotected final Consumer<? super org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration> protected final booleanprotected final Function<DateFormat, javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>> protected Supplier<org.jboss.resteasy.spi.ResteasyProviderFactory> protected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedA new JaxRS adapter backed by RESTEasy. -
Method Summary
Modifier and TypeMethodDescriptionstatic JaxRsAdapterRestEasyBuilderbuilder()javax.ws.rs.client.ClientbuildHttpClient(ApiClientConfig config) <T> Tdeserialize(javax.ws.rs.core.Response response, javax.ws.rs.core.GenericType<T> returnType, ApiClientConfig config, Formatter formatter) Deserialize response body to Java object according to the content type.protected final FiledownloadFileFromResponse(javax.ws.rs.core.Response response) Download file from the given response.protected final FileprepareDownloadFile(javax.ws.rs.core.Response response) javax.ws.rs.client.Entity<?> serialize(Object obj, String contentType, ApiClientConfig config, Formatter formatter) Serialize the given Java object into string entity according the given content type.
-
Field Details
-
objectMapperResolverFactory
protected final Function<DateFormat, javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>> objectMapperResolverFactory -
tempFolderPath
-
logging
protected final boolean logging -
buildClient
protected final Function<? super org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder, ? extends javax.ws.rs.client.Client> buildClient -
configClient
protected final Consumer<? super org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration> configClient -
clientHttpEngine
protected final org.jboss.resteasy.client.jaxrs.ClientHttpEngine clientHttpEngine -
providerFactorySupplier
-
-
Constructor Details
-
JaxRsAdapterRestEasy
A new JaxRS adapter backed by RESTEasy.- Parameters:
builder- The builder with the configuration for this instance.
-
-
Method Details
-
buildHttpClient
- Specified by:
buildHttpClientin interfaceJaxRsAdapter- Parameters:
config- The current API client config.- Returns:
- A new Jax RS client to use.
-
serialize
public javax.ws.rs.client.Entity<?> serialize(Object obj, String contentType, ApiClientConfig config, Formatter formatter) throws ApiException Description copied from interface:JaxRsAdapterSerialize the given Java object into string entity according the given content type.- Specified by:
serializein interfaceJaxRsAdapter- Parameters:
obj- the object to serializecontentType- the content typeconfig- The current API client configformatter- The formatting helper- Returns:
- The serialized
Entity - Throws:
ApiException- On failure to serialize
-
deserialize
public <T> T deserialize(javax.ws.rs.core.Response response, javax.ws.rs.core.GenericType<T> returnType, ApiClientConfig config, Formatter formatter) throws ApiException Description copied from interface:JaxRsAdapterDeserialize response body to Java object according to the content type.- Specified by:
deserializein interfaceJaxRsAdapter- Type Parameters:
T- a Java type parameter- Parameters:
response- the response body to deserializereturnType- a Java type to deserialize intoconfig- The current API client configformatter- The formatting helper- Returns:
- A deserialized Java object
- Throws:
ApiException- on failure to deserialize
-
downloadFileFromResponse
protected final File downloadFileFromResponse(javax.ws.rs.core.Response response) throws ApiException Download file from the given response.- Parameters:
response- a response- Returns:
- a file from the given response
- Throws:
ApiException- If fail to read file content from response and write to disk
-
prepareDownloadFile
- Throws:
IOException
-
builder
- Returns:
- A new builder for configuring a JaxRS RestEASY adapter.
-