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
The
SPARQLServiceResolver is used to manage a set of FederatedService instances, 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, a SPARQLFederatedService is created and registered for future use.
- Author:
- Andreas Schwarte, James Leigh
-
Field Summary
Fields inherited from class AbstractFederatedServiceResolver
endpointToServiceModifier and TypeFieldDescriptionprotected Map<String, FederatedService> Map service URL to the corresponding initializedFederatedService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FederatedServicecreateService(String serviceUrl) Create a newFederatedServicefor the given serviceUrl.RDF4JHttpClientthat has been assigned or has been used by this object.HttpClientSessionManagerthat has been assigned or has been used by this object.voidsetHttpClient(RDF4JHttpClient httpClient) Assign anRDF4JHttpClientthat this object should use.voidAssign anHttpClientSessionManagerthat this object should use.voidshutDown()Methods inherited from class AbstractFederatedServiceResolver
getService, hasService, registerService, unregisterAll, unregisterServiceModifier and TypeMethodDescriptiongetService(String serviceUrl) Retrieve theFederatedServiceregistered for serviceUrl.booleanhasService(String serviceUrl) Verify if a registeredFederatedServiceexists for the given serviceUrul.voidregisterService(String serviceUrl, FederatedService service) Register the specified service to evaluate SERVICE expressions for the given url.voidvoidunregisterService(String serviceUrl) Unregister a service registered to serviceURl
-
Constructor Details
-
SPARQLServiceResolver
public SPARQLServiceResolver()
-
-
Method Details
-
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
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- Parameters:
client-
-
getHttpClient
Description copied from interface:HttpClientDependentRDF4JHttpClientthat 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 whetherRDF4JHttpClientwas passed to or created by this object respectively.- Specified by:
getHttpClientin interfaceHttpClientDependent- Returns:
- an
RDF4JHttpClientinstance or null
-
setHttpClient
Description copied from interface:HttpClientDependentAssign anRDF4JHttpClientthat this object should use. The life cycle of the givenRDF4JHttpClientis 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- Parameters:
httpClient-
-
createService
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
-