org.eclipse.rdf4j.federated.repository

## Class FedXRepository

- java.lang.Object
- - org.eclipse.rdf4j.repository.base.AbstractRepository
  - - org.eclipse.rdf4j.repository.sail.SailRepository
    - - org.eclipse.rdf4j.federated.repository.FedXRepository

- All Implemented Interfaces:
    HttpClientDependent, SesameClientDependent, SessionManagerDependent, FederatedServiceResolverClient, Repository, RepositoryResolverClient

      public class FedXRepository
      extends SailRepository

  A special `SailRepository` which performs the actions as defined in `FedXRepositoryConnection`.
  Author:
    as

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FedXRepository(FedX federation, FedXConfig config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FedXRepositoryConnection` | `getConnection()` Opens a connection to this repository that can be used for querying and updating the contents of the repository.
    `FederationContext` | `getFederationContext()`
    `String` | `getFederationSize()` return the number of triples in the federation as string.
    `QueryManager` | `getQueryManager()`
    `protected void` | `initializeInternal()`
    `void` | `setFederatedServiceResolver(FederatedServiceResolver resolver)` Sets the `FederatedServiceResolver` to use for this client.
    `protected void` | `shutDownInternal()`

    - ### Methods inherited from class org.eclipse.rdf4j.repository.sail.SailRepository

      `getDataDir, getHttpClient, getHttpClientSessionManager, getSail, getValueFactory, isWritable, setDataDir, setHttpClient, setHttpClientSessionManager, setRepositoryResolver, toString`

    - ### Methods inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository

      `init, initialize, isInitialized, shutDown`

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

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

    - ### Methods inherited from interface org.eclipse.rdf4j.http.client.SesameClientDependent

      `getSesameClient, setSesameClient`

- - ### Constructor Detail

    - #### FedXRepository

          public FedXRepository(FedX federation,
                                FedXConfig config)

  - ### Method Detail

    - #### getConnection

          public FedXRepositoryConnection getConnection()
                                                 throws RepositoryException

      Description copied from interface: `Repository`
      Opens a connection to this repository that can be used for querying and updating the contents of the repository. Created connections need to be closed to make sure that any resources they keep hold of are released. The best way to do this is to use a try-with-resources block, as follows:

           try (RepositoryConnection conn = repository.getConnection()) {
                  // perform operations on the connection
           }

      Note that `RepositoryConnection` is not guaranteed to be thread-safe! The recommended pattern for repository access in a multi-threaded application is to share the Repository object between threads, but have each thread create and use its own `RepositoryConnection`s.
      Specified by:
        `getConnection` in interface `Repository`
      Overrides:
        `getConnection` in class `SailRepository`
      Returns:
        A connection that allows operations on this repository.
      Throws:
        `RepositoryException` - If something went wrong during the creation of the Connection.

    - #### initializeInternal

          protected void initializeInternal()
                                     throws RepositoryException

      Overrides:
        `initializeInternal` in class `SailRepository`
      Throws:
        `RepositoryException`

    - #### shutDownInternal

          protected void shutDownInternal()
                                   throws RepositoryException

      Overrides:
        `shutDownInternal` in class `SailRepository`
      Throws:
        `RepositoryException`

    - #### setFederatedServiceResolver

          public void setFederatedServiceResolver(FederatedServiceResolver resolver)

      Description copied from interface: `FederatedServiceResolverClient`
      Sets the `FederatedServiceResolver` to use for this client.
      Specified by:
        `setFederatedServiceResolver` in interface `FederatedServiceResolverClient`
      Overrides:
        `setFederatedServiceResolver` in class `SailRepository`
      Parameters:
        `resolver` - The resolver to use.

    - #### getFederationSize

          public String getFederationSize()

      return the number of triples in the federation as string. Retrieving the size is only supported `EndpointType.NativeStore` and `EndpointType.RemoteRepository`. If the federation contains other types of endpoints, the size is indicated as a lower bound, i.e. the string starts with a larger sign.
      Returns:
        the number of triples in the federation

    - #### getFederationContext

          public FederationContext getFederationContext()

      Returns:
        the `FederationContext`

    - #### getQueryManager

          public QueryManager getQueryManager()

      Returns:
        the `QueryManager` from the `FederationContext`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.