Class AbstractFederatedServiceResolver
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver
-
- All Implemented Interfaces:
FederatedServiceResolver
- Direct Known Subclasses:
DelegateFederatedServiceResolver
,FederatedServiceResolverBase
,SPARQLServiceResolver
public abstract class AbstractFederatedServiceResolver extends Object implements FederatedServiceResolver
Base class forFederatedServiceResolver
which takes care for lifecycle management of producedFederatedService
s.Specific implementation can implement
createService(String)
.- Author:
- Andreas Schwarte
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,FederatedService>
endpointToService
Map 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 FederatedService
createService(String serviceUrl)
Create a newFederatedService
for the given serviceUrl.FederatedService
getService(String serviceUrl)
Retrieve theFederatedService
registered for serviceUrl.boolean
hasService(String serviceUrl)
Verify if a registeredFederatedService
exists for the given serviceUrul.void
registerService(String serviceUrl, FederatedService service)
Register the specified service to evaluate SERVICE expressions for the given url.void
shutDown()
void
unregisterAll()
void
unregisterService(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 theFederatedService
registered for serviceUrl. If there is no service registered for serviceUrl, a newFederatedService
is created and registered.- Specified by:
getService
in 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 registeredFederatedService
exists for the given serviceUrul.- Parameters:
serviceUrl
- locator for the federation service.- Returns:
true
iff the FederatedService has been registered,false
otherwise.
-
createService
protected abstract FederatedService createService(String serviceUrl) throws QueryEvaluationException
Create a newFederatedService
for the given serviceUrl. This method is invoked, if noFederatedService
has 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()
-
-