public class SharedHttpClientSessionManager extends Object implements HttpClientSessionManager, HttpClientDependent
HttpClient
to manage HTTP connections.Modifier and Type | Field and Description |
---|---|
static String |
CORE_POOL_SIZE_PROPERTY
Configurable system property
org.eclipse.rdf4j.client.executors.corePoolSize for specifying the
background executor core thread pool size. |
Constructor and Description |
---|
SharedHttpClientSessionManager() |
SharedHttpClientSessionManager(org.apache.http.impl.client.CloseableHttpClient dependentClient,
ScheduledExecutorService dependentExecutorService) |
Modifier and Type | Method and Description |
---|---|
RDF4JProtocolSession |
createRDF4JProtocolSession(String serverURL)
Creates a new session to the remote RDF4J REST API.
|
SPARQLProtocolSession |
createSPARQLProtocolSession(String queryEndpointUrl,
String updateEndpointUrl)
Creates a new SPARQL Protocol session to the remote SPARQL endpoint.
|
protected ExecutorService |
getExecutorService()
Get the
ExecutorService used by this session manager. |
org.apache.http.client.HttpClient |
getHttpClient()
HttpClient that has been assigned or has been used by this object. |
void |
initialize()
Deprecated.
Create a new instance instead of trying to reactivate an old instance.
|
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Assign an
HttpClient that this object should use. |
void |
setHttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder httpClientBuilder)
Set an optional
HttpClientBuilder to create the inner httpClient (if the latter is not provided
externally as dependent client). |
void |
shutDown()
Closes any remaining connections and threads used by the sessions created by this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSesameSession, createSparqlSession
public static final String CORE_POOL_SIZE_PROPERTY
org.eclipse.rdf4j.client.executors.corePoolSize
for specifying the
background executor core thread pool size.public SharedHttpClientSessionManager()
public SharedHttpClientSessionManager(org.apache.http.impl.client.CloseableHttpClient dependentClient, ScheduledExecutorService dependentExecutorService)
public org.apache.http.client.HttpClient getHttpClient()
HttpClientDependent
HttpClient
that has been assigned or has been used by this object. The life cycle might not be or might
be tied to this object, depending on whether HttpClient
was passed to or created by this object
respectively.getHttpClient
in interface HttpClientDependent
getHttpClient
in interface HttpClientSessionManager
getHttpClient
in interface SesameClient
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
HttpClientDependent
HttpClient
that this object should use. The life cycle of the given HttpClient
is
independent of this object. Closing or shutting down this object does not have any impact on the given client.
Callers must ensure that the given client is properly closed elsewhere.setHttpClient
in interface HttpClientDependent
httpClient
- The httpClient to use for remote/service calls.public void setHttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder httpClientBuilder)
HttpClientBuilder
to create the inner httpClient
(if the latter is not provided
externally as dependent client).httpClientBuilder
- the builder for the managed HttpClientHttpClientBuilders
public SPARQLProtocolSession createSPARQLProtocolSession(String queryEndpointUrl, String updateEndpointUrl)
HttpClientSessionManager
createSPARQLProtocolSession
in interface HttpClientSessionManager
createSPARQLProtocolSession
in interface SesameClient
public RDF4JProtocolSession createRDF4JProtocolSession(String serverURL)
HttpClientSessionManager
createRDF4JProtocolSession
in interface HttpClientSessionManager
createRDF4JProtocolSession
in interface SesameClient
public void shutDown()
HttpClientSessionManager
shutDown
in interface HttpClientSessionManager
shutDown
in interface SesameClient
@Deprecated public void initialize()
protected final ExecutorService getExecutorService()
ExecutorService
used by this session manager.ExecutorService
used by all SPARQLProtocolSession
and RDF4JProtocolSession
instances created by this session manager.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.