Package com.attivio.sdk.scanner.http
Interface HttpClientProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
MockBasicAuthenticationProvider
public interface HttpClientProvider extends java.io.Closeable
This interface should be used by the scanner to obtain the Http client object. Attivio passes the provider to the scanner inHttpDataSourceScanner.setHttpProvider(com.attivio.sdk.scanner.http.HttpClientProvider)
. The scanner should callCloseable.close()
before existingDataSourceScanner.start(String connectorName, DocumentPublisher publisher)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.http.impl.client.CloseableHttpClient
prepareHttpClient(java.lang.String url)
This method should be called by the scanner before every execution of an Http command.
-
-
-
Method Detail
-
prepareHttpClient
org.apache.http.impl.client.CloseableHttpClient prepareHttpClient(java.lang.String url)
This method should be called by the scanner before every execution of an Http command. It is typically a lightweight call since the provider returns the same client object if it is still valid. The provider will create a new client when needed, for example when the client has timed out. The url that the scanner is going to execute should be passed toprepareHttpClient(String url)
for cases where different Http clients are provided for different Urls. For example when different authentication is required.- Parameters:
url
- The url the returned Http client will be used for.- Returns:
- Http client to be used by the scanner
-
-