Class SPARQLServiceResolver
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver
-
- org.eclipse.rdf4j.repository.sparql.federation.SPARQLServiceResolver
-
- All Implemented Interfaces:
HttpClientDependent,SessionManagerDependent,FederatedServiceResolver
public class SPARQLServiceResolver extends AbstractFederatedServiceResolver implements HttpClientDependent, SessionManagerDependent
TheSPARQLServiceResolveris used to manage a set ofFederatedServiceinstances, which are used to evaluate SERVICE expressions for particular service Urls.Lookup can be done via the serviceUrl using the method
AbstractFederatedServiceResolver.getService(String). If there is no service for the specified url, aSPARQLFederatedServiceis created and registered for future use.- Author:
- Andreas Schwarte, James Leigh
-
-
Field Summary
-
Fields inherited from class org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver
endpointToService
-
-
Constructor Summary
Constructors Constructor Description SPARQLServiceResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FederatedServicecreateService(String serviceUrl)Create a newFederatedServicefor the given serviceUrl.org.apache.http.client.HttpClientgetHttpClient()HttpClientthat has been assigned or has been used by this object.HttpClientSessionManagergetHttpClientSessionManager()HttpClientSessionManagerthat has been assigned or has been used by this object.voidsetHttpClient(org.apache.http.client.HttpClient httpClient)Assign anHttpClientthat this object should use.voidsetHttpClientSessionManager(HttpClientSessionManager client)Assign anHttpClientSessionManagerthat this object should use.voidshutDown()-
Methods inherited from class org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver
getService, hasService, registerService, unregisterAll, unregisterService
-
-
-
-
Method Detail
-
getHttpClientSessionManager
public HttpClientSessionManager getHttpClientSessionManager()
Description copied from interface:SessionManagerDependentHttpClientSessionManagerthat 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 whetherHttpClientSessionManagerwas passed to or created by this object respectively.- Specified by:
getHttpClientSessionManagerin interfaceSessionManagerDependent- Returns:
- a
HttpClientSessionManagerinstance or null
-
setHttpClientSessionManager
public void setHttpClientSessionManager(HttpClientSessionManager client)
Description copied from interface:SessionManagerDependentAssign anHttpClientSessionManagerthat this object should use. The life cycle of the givenHttpClientSessionManageris 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.- Specified by:
setHttpClientSessionManagerin interfaceSessionManagerDependent
-
getHttpClient
public org.apache.http.client.HttpClient getHttpClient()
Description copied from interface:HttpClientDependentHttpClientthat 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 whetherHttpClientwas passed to or created by this object respectively.- Specified by:
getHttpClientin interfaceHttpClientDependent- Returns:
- an
HttpClientinstance or null
-
setHttpClient
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
Description copied from interface:HttpClientDependentAssign anHttpClientthat this object should use. The life cycle of the givenHttpClientis 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.- Specified by:
setHttpClientin interfaceHttpClientDependent
-
createService
protected FederatedService createService(String serviceUrl) throws QueryEvaluationException
Description copied from class:AbstractFederatedServiceResolverCreate a newFederatedServicefor the given serviceUrl. This method is invoked, if noFederatedServicehas been created yet for the serviceUrl.- Specified by:
createServicein classAbstractFederatedServiceResolver- Parameters:
serviceUrl- the service IRI- Returns:
- a non-null
FederatedService - Throws:
QueryEvaluationException
-
shutDown
public void shutDown()
- Overrides:
shutDownin classAbstractFederatedServiceResolver
-
-