Package org.eclipse.rdf4j.query.algebra.evaluation.federation

## 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 for `FederatedServiceResolver` which takes care for lifecycle management of produced `FederatedService`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 initialized `FederatedService`

  - ### 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 new `FederatedService` for the given serviceUrl.
    `FederatedService` | `getService​(String serviceUrl)` | Retrieve the `FederatedService` registered for serviceUrl.
    `boolean` | `hasService​(String serviceUrl)` | Verify if a registered `FederatedService` 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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### endpointToService

          protected Map<String,​FederatedService> endpointToService

      Map service URL to the corresponding initialized `FederatedService`

  - ### Constructor Detail

    - #### AbstractFederatedServiceResolver

          public AbstractFederatedServiceResolver()

  - ### 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 the `FederatedService` registered for serviceUrl. If there is no service registered for serviceUrl, a new `FederatedService` is created and registered.
      Specified by:
        `getService` in interface `FederatedServiceResolver`
      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 registered `FederatedService` 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 new `FederatedService` for the given serviceUrl. This method is invoked, if no `FederatedService` 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()