Package org.geotools.http
Class AbstractHTTPClientFactory
- Object
-
- AbstractHTTPClientFactory
-
- All Implemented Interfaces:
HTTPClientFactory
- Direct Known Subclasses:
DefaultHTTPClientFactory
,MultithreadedHttpClientFactory
public abstract class AbstractHTTPClientFactory extends Object implements HTTPClientFactory
Base HTTPClientFactory adding wrapper client's to the desired HTTP Client like for instance LoggingHTTPClient.- Author:
- Roar Brænden
-
-
Constructor Summary
Constructors Constructor Description AbstractHTTPClientFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected HTTPClient
applyLogging(HTTPClient client, Hints hints)
Wraps client with a LoggingHTTPClient if the HTTP_LOGGING hint is set.boolean
canProcess(Hints hints, List<Class<? extends HTTPBehavior>> behaviors)
Returns true if a given factory have a HTTP_CLIENT given by the hint, or meets the behaviors.protected abstract List<Class<?>>
clientClasses()
Return the HTTPClient classes that this factory will create.abstract HTTPClient
createClient(List<Class<? extends HTTPBehavior>> behaviors)
Create instance of HTTPClient.HTTPClient
createClient(Hints hints, List<Class<? extends HTTPBehavior>> behaviors)
Called by HTTPFactoryFinder to create clientprotected HTTPClient
createLogging(HTTPClient client)
-
-
-
Method Detail
-
canProcess
public final boolean canProcess(Hints hints, List<Class<? extends HTTPBehavior>> behaviors)
Returns true if a given factory have a HTTP_CLIENT given by the hint, or meets the behaviors.- Specified by:
canProcess
in interfaceHTTPClientFactory
- Returns:
- Client class
-
clientClasses
protected abstract List<Class<?>> clientClasses()
Return the HTTPClient classes that this factory will create.- Returns:
-
createClient
public abstract HTTPClient createClient(List<Class<? extends HTTPBehavior>> behaviors)
Create instance of HTTPClient. Behaviors should be used if factory creates different client's. Otherwise it's excessive to use.- Specified by:
createClient
in interfaceHTTPClientFactory
- Returns:
- default http client
-
createClient
public final HTTPClient createClient(Hints hints, List<Class<? extends HTTPBehavior>> behaviors)
Description copied from interface:HTTPClientFactory
Called by HTTPFactoryFinder to create clientTakes care of any delegation
- Specified by:
createClient
in interfaceHTTPClientFactory
- Parameters:
hints
- Merged with system defaults- Returns:
-
applyLogging
protected HTTPClient applyLogging(HTTPClient client, Hints hints)
Wraps client with a LoggingHTTPClient if the HTTP_LOGGING hint is set.- Parameters:
client
-hints
-- Returns:
-
createLogging
protected HTTPClient createLogging(HTTPClient client)
-
-