Package org.eclipse.rdf4j.federated.repository

## Class FedXRepositoryWrapper

- java.lang.Object
- - org.eclipse.rdf4j.repository.base.RepositoryWrapper
  - - org.eclipse.rdf4j.federated.repository.FedXRepositoryWrapper

- All Implemented Interfaces:
    `FederatedServiceResolverClient`, `DelegatingRepository`, `Repository`, `RepositoryResolverClient`

      public class FedXRepositoryWrapper
      extends RepositoryWrapper
      implements RepositoryResolverClient, FederatedServiceResolverClient

  Wrapper for the `FedXRepository` in order to allow for lazy initialization.

  The wrapper is used from `FedXRepositoryFactory` in environments with a `RepositoryManager`, e.g. in the RDF4J workbench. The background is that the RDF4J repository manager requires control over the repository instance.

  The data directory and the `RepositoryResolver` are handled by RDF4J `RepositoryManager`.

  Author:
    Andreas Schwarte
  See Also:
    `FedXFactory`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FedXRepositoryWrapper​(FedXRepositoryConfig fedXConfig)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected FedXFactory` | `createFactory()` | Create the initialized `FedXFactory`
    `File` | `getDataDir()` | Get the directory where data and logging for this repository is stored.
    `void` | `init()` | Initializes this repository.
    `boolean` | `isInitialized()` | Indicates if the Repository has been initialized.
    `void` | `setDataDir​(File dataDir)` | Set the directory where data and logging for this repository is stored.
    `void` | `setFederatedServiceResolver​(FederatedServiceResolver resolver)` | Sets the `FederatedServiceResolver` to use for this client.
    `void` | `setRepositoryResolver​(RepositoryResolver resolver)` |
    `void` | `shutDown()` | Shuts the repository down, releasing any resources that it keeps hold of.

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

      `getConnection, getDelegate, getValueFactory, isWritable, setDelegate, toString`

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

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

- - ### Constructor Detail

    - #### FedXRepositoryWrapper

          public FedXRepositoryWrapper​(FedXRepositoryConfig fedXConfig)

  - ### Method Detail

    - #### setDataDir

          public void setDataDir​(File dataDir)

      Description copied from interface: `Repository`
      Set the directory where data and logging for this repository is stored.
      Specified by:
        `setDataDir` in interface `Repository`
      Overrides:
        `setDataDir` in class `RepositoryWrapper`
      Parameters:
        `dataDir` - the directory where data for this repository is stored

    - #### getDataDir

          public File getDataDir()

      Description copied from interface: `Repository`
      Get the directory where data and logging for this repository is stored.
      Specified by:
        `getDataDir` in interface `Repository`
      Overrides:
        `getDataDir` in class `RepositoryWrapper`
      Returns:
        the directory where data for this repository is stored.

    - #### isInitialized

          public boolean isInitialized()

      Description copied from interface: `Repository`
      Indicates if the Repository has been initialized. Note that the initialization status may change if the Repository is shut down.
      Specified by:
        `isInitialized` in interface `Repository`
      Overrides:
        `isInitialized` in class `RepositoryWrapper`
      Returns:
        true iff the repository has been initialized.

    - #### init

          public void init()
                    throws RepositoryException

      Description copied from interface: `Repository`
      Initializes this repository. A repository needs to be initialized before it can be used, however explicitly calling this method is not necessary: the repository will automatically initialize itself if an operation is executed on it that requires it to be initialized.
      Specified by:
        `init` in interface `Repository`
      Overrides:
        `init` in class `RepositoryWrapper`
      Throws:
        `RepositoryException` - If the initialization failed.

    - #### createFactory

          protected FedXFactory createFactory()

      Create the initialized `FedXFactory`
      Returns:

    - #### shutDown

          public void shutDown()
                        throws RepositoryException

      Description copied from interface: `Repository`
      Shuts the repository down, releasing any resources that it keeps hold of. Once shut down, the repository can no longer be used until it is re-initialized.
      Specified by:
        `shutDown` in interface `Repository`
      Overrides:
        `shutDown` in class `RepositoryWrapper`
      Throws:
        `RepositoryException`

    - #### setRepositoryResolver

          public void setRepositoryResolver​(RepositoryResolver resolver)

      Specified by:
        `setRepositoryResolver` in interface `RepositoryResolverClient`

    - #### 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`
      Parameters:
        `resolver` - The resolver to use.