Package org.mapfish.print.http
Class ConfigFileResolvingHttpRequestFactory
- java.lang.Object
-
- org.mapfish.print.http.ConfigFileResolvingHttpRequestFactory
-
- All Implemented Interfaces:
MfClientHttpRequestFactory
,org.springframework.http.client.ClientHttpRequestFactory
public final class ConfigFileResolvingHttpRequestFactory extends java.lang.Object implements MfClientHttpRequestFactory
This request factory will attempt to load resources usingConfiguration.loadFile(String)
andConfiguration.isAccessible(String)
to load the resources if the http method is GET and will fallback to the normal/wrapped factory to make http requests.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapfish.print.http.MfClientHttpRequestFactory
MfClientHttpRequestFactory.RequestConfigurator
-
-
Constructor Summary
Constructors Constructor Description ConfigFileResolvingHttpRequestFactory(MfClientHttpRequestFactoryImpl httpRequestFactory, Configuration config, java.util.Map<java.lang.String,java.lang.String> mdcContext, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.client.ClientHttpRequest
createRequest(java.net.URI uri, org.springframework.http.HttpMethod httpMethod)
java.util.List<MfClientHttpRequestFactory.RequestConfigurator>
getCallbacks()
Configuration
getConfig()
MfClientHttpRequestFactoryImpl
getHttpRequestFactory()
int
getHttpRequestFetchRetryIntervalMillis()
int
getHttpRequestMaxNumberFetchRetry()
java.util.Map<java.lang.String,java.lang.String>
getMdcContext()
void
register(MfClientHttpRequestFactory.RequestConfigurator callback)
Register a callback for config using a http request.
-
-
-
Constructor Detail
-
ConfigFileResolvingHttpRequestFactory
public ConfigFileResolvingHttpRequestFactory(MfClientHttpRequestFactoryImpl httpRequestFactory, Configuration config, @Nonnull java.util.Map<java.lang.String,java.lang.String> mdcContext, int httpRequestMaxNumberFetchRetry, int httpRequestFetchRetryIntervalMillis)
Constructor.- Parameters:
httpRequestFactory
- basic request factoryconfig
- the template for the current print job.mdcContext
- the mdc context for the current print job.
-
-
Method Detail
-
register
public void register(@Nonnull MfClientHttpRequestFactory.RequestConfigurator callback)
Description copied from interface:MfClientHttpRequestFactory
Register a callback for config using a http request.- Specified by:
register
in interfaceMfClientHttpRequestFactory
- Parameters:
callback
- the configuration callback
-
createRequest
public org.springframework.http.client.ClientHttpRequest createRequest(java.net.URI uri, org.springframework.http.HttpMethod httpMethod)
- Specified by:
createRequest
in interfaceorg.springframework.http.client.ClientHttpRequestFactory
-
getHttpRequestFactory
public MfClientHttpRequestFactoryImpl getHttpRequestFactory()
-
getMdcContext
@Nonnull public java.util.Map<java.lang.String,java.lang.String> getMdcContext()
-
getConfig
public Configuration getConfig()
-
getHttpRequestMaxNumberFetchRetry
public int getHttpRequestMaxNumberFetchRetry()
-
getHttpRequestFetchRetryIntervalMillis
public int getHttpRequestFetchRetryIntervalMillis()
-
getCallbacks
public java.util.List<MfClientHttpRequestFactory.RequestConfigurator> getCallbacks()
-
-