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 for
FederatedServiceResolver
which takes care for lifecycle management of produced
FederatedService
s.
Specific implementation can implement createService(String)
.
- Author:
- Andreas Schwarte
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<String, FederatedService> Map service URL to the corresponding initializedFederatedService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract FederatedService
createService
(String serviceUrl) Create a newFederatedService
for the given serviceUrl.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
void
unregisterService
(String serviceUrl) Unregister a service registered to serviceURl
-
Field Details
-
endpointToService
Map service URL to the corresponding initializedFederatedService
-
-
Constructor Details
-
AbstractFederatedServiceResolver
public AbstractFederatedServiceResolver()
-
-
Method Details
-
registerService
Register the specified service to evaluate SERVICE expressions for the given url.- Parameters:
serviceUrl
-service
-
-
unregisterService
Unregister a service registered to serviceURl- Parameters:
serviceUrl
-
-
getService
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
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()
-