Class JaxRsAdapterRestEasy
- java.lang.Object
-
- de.xima.fc.api.rest.pub.client.generic.JaxRsAdapterRestEasy
-
- All Implemented Interfaces:
JaxRsAdapter
@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator") public class JaxRsAdapterRestEasy extends Object implements JaxRsAdapterAdapter 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
Fields Modifier and Type Field Description protected Function<? super org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder,? extends javax.ws.rs.client.Client>buildClientprotected org.jboss.resteasy.client.jaxrs.ClientHttpEngineclientHttpEngineprotected Consumer<? super org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration>configClientprotected booleanloggingprotected Function<DateFormat,javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>>objectMapperResolverFactoryprotected Supplier<org.jboss.resteasy.spi.ResteasyProviderFactory>providerFactorySupplierprotected StringtempFolderPath
-
Constructor Summary
Constructors Modifier Constructor Description protectedJaxRsAdapterRestEasy(JaxRsAdapterRestEasyBuilder builder)A new JaxRS adapter backed by RESTEasy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 FiledownloadFileFromResponse(javax.ws.rs.core.Response response)Download file from the given response.protected 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 Detail
-
objectMapperResolverFactory
protected final Function<DateFormat,javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>> objectMapperResolverFactory
-
tempFolderPath
protected final String 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
protected Supplier<org.jboss.resteasy.spi.ResteasyProviderFactory> providerFactorySupplier
-
-
Constructor Detail
-
JaxRsAdapterRestEasy
protected JaxRsAdapterRestEasy(JaxRsAdapterRestEasyBuilder builder)
A new JaxRS adapter backed by RESTEasy.- Parameters:
builder- The builder with the configuration for this instance.
-
-
Method Detail
-
buildHttpClient
public javax.ws.rs.client.Client buildHttpClient(ApiClientConfig config)
- 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 ApiExceptionDescription 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
protected final File prepareDownloadFile(javax.ws.rs.core.Response response) throws IOException
- Throws:
IOException
-
builder
public static JaxRsAdapterRestEasyBuilder builder()
- Returns:
- A new builder for configuring a JaxRS RestEASY adapter.
-
-