Class AbstractFederatedServiceResolver
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver
-
- All Implemented Interfaces:
FederatedServiceResolver
- Direct Known Subclasses:
DelegateFederatedServiceResolver,SPARQLServiceResolver
public abstract class AbstractFederatedServiceResolver extends Object implements FederatedServiceResolver
Base class forFederatedServiceResolverwhich takes care for lifecycle management of producedFederatedServices.Specific implementation can implement
createService(String).- Author:
- Andreas Schwarte
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,FederatedService>endpointToServiceMap service URL to the corresponding initializedFederatedService
-
Constructor Summary
Constructors Constructor Description AbstractFederatedServiceResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract FederatedServicecreateService(String serviceUrl)Create a newFederatedServicefor the given serviceUrl.FederatedServicegetService(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.voidshutDown()voidunregisterAll()voidunregisterService(String serviceUrl)Unregister a service registered to serviceURl
-
-
-
Field Detail
-
endpointToService
protected Map<String,FederatedService> endpointToService
Map service URL to the corresponding initializedFederatedService
-
-
Method Detail
-
registerService
public void registerService(String serviceUrl, FederatedService service)
Register the specified service to evaluate SERVICE expressions for the given url.- Parameters:
serviceUrl-service-
-
unregisterService
public void unregisterService(String serviceUrl)
Unregister a service registered to serviceURl- Parameters:
serviceUrl-
-
getService
public FederatedService getService(String serviceUrl) throws QueryEvaluationException
Retrieve theFederatedServiceregistered for serviceUrl. If there is no service registered for serviceUrl, a newFederatedServiceis created and registered.- Specified by:
getServicein interfaceFederatedServiceResolver- Parameters:
serviceUrl- locator for the federation service- Returns:
- the
FederatedService, created fresh if necessary - Throws:
QueryEvaluationException
-
hasService
public boolean hasService(String serviceUrl)
Verify if a registeredFederatedServiceexists for the given serviceUrul.- Parameters:
serviceUrl- locator for the federation service.- Returns:
trueiff the FederatedService has been registered,falseotherwise.
-
createService
protected abstract FederatedService createService(String serviceUrl) throws QueryEvaluationException
Create a newFederatedServicefor the given serviceUrl. This method is invoked, if noFederatedServicehas been created yet for the serviceUrl.- Parameters:
serviceUrl- the service IRI- Returns:
- a non-null
FederatedService - Throws:
QueryEvaluationException
-
unregisterAll
public void unregisterAll()
-
shutDown
public void shutDown()
-
-