Package org.eclipse.rdf4j.repository.sparql.federation

## 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 FederatedServiceResolver, 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 org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver

      `endpointToService`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SPARQLServiceResolver()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected FederatedService` | `createService​(String serviceUrl)` | Create a new `FederatedService` for the given serviceUrl.
    `org.apache.http.client.HttpClient` | `getHttpClient()` | `HttpClient` that has been assigned or has been used by this object.
    `HttpClientSessionManager` | `getHttpClientSessionManager()` | `HttpClientSessionManager` that has been assigned or has been used by this object.
    `void` | `setHttpClient​(org.apache.http.client.HttpClient httpClient)` | Assign an `HttpClient` that this object should use.
    `void` | `setHttpClientSessionManager​(HttpClientSessionManager client)` | Assign an `HttpClientSessionManager` that this object should use.
    `void` | `shutDown()` |

    - ### Methods inherited from class org.eclipse.rdf4j.query.algebra.evaluation.federation.AbstractFederatedServiceResolver

      `getService, hasService, registerService, unregisterAll, unregisterService`

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

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

    - ### Methods inherited from interface org.eclipse.rdf4j.query.algebra.evaluation.federation.FederatedServiceResolver

      `getService`

- - ### Constructor Detail

    - #### SPARQLServiceResolver

          public SPARQLServiceResolver()

  - ### Method Detail

    - #### getHttpClientSessionManager

          public HttpClientSessionManager getHttpClientSessionManager()

      Description copied from interface: `SessionManagerDependent`
      `HttpClientSessionManager` that 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 whether `HttpClientSessionManager` was passed to or created by this object respectively.
      Specified by:
        `getHttpClientSessionManager` in interface `SessionManagerDependent`
      Returns:
        a `HttpClientSessionManager` instance or null

    - #### setHttpClientSessionManager

          public void setHttpClientSessionManager​(HttpClientSessionManager client)

      Description copied from interface: `SessionManagerDependent`
      Assign an `HttpClientSessionManager` that this object should use. The life cycle of the given `HttpClientSessionManager` is 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:
        `setHttpClientSessionManager` in interface `SessionManagerDependent`

    - #### getHttpClient

          public org.apache.http.client.HttpClient getHttpClient()

      Description copied from interface: `HttpClientDependent`
      `HttpClient` that 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 whether `HttpClient` was passed to or created by this object respectively.
      Specified by:
        `getHttpClient` in interface `HttpClientDependent`
      Returns:
        an `HttpClient` instance or null

    - #### setHttpClient

          public void setHttpClient​(org.apache.http.client.HttpClient httpClient)

      Description copied from interface: `HttpClientDependent`
      Assign an `HttpClient` that this object should use. The life cycle of the given `HttpClient` is 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:
        `setHttpClient` in interface `HttpClientDependent`

    - #### createService

          protected FederatedService createService​(String serviceUrl)
                                            throws QueryEvaluationException

      Description copied from class: `AbstractFederatedServiceResolver`
      Create a new `FederatedService` for the given serviceUrl. This method is invoked, if no `FederatedService` has been created yet for the serviceUrl.
      Specified by:
        `createService` in class `AbstractFederatedServiceResolver`
      Parameters:
        `serviceUrl` - the service IRI
      Returns:
        a non-null `FederatedService`
      Throws:
        `QueryEvaluationException`

    - #### shutDown

          public void shutDown()

      Overrides:
        `shutDown` in class `AbstractFederatedServiceResolver`