org.eclipse.rdf4j.repository.manager.util

## Class TypeFilteringRepositoryManager

- java.lang.Object
- - org.eclipse.rdf4j.repository.manager.RepositoryManager
  - - org.eclipse.rdf4j.repository.manager.util.TypeFilteringRepositoryManager

- All Implemented Interfaces:
    HttpClientDependent, RepositoryResolver

      public class TypeFilteringRepositoryManager
      extends RepositoryManager

  Author:
    Herko ter Horst, Arjohn Kampman

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.repository.manager.RepositoryManager

      `initializedRepositories, logger, NAMESPACE, PROXIED_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeFilteringRepositoryManager(String type, RepositoryManager delegate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRepositoryConfig(RepositoryConfig config)` Adds or updates the configuration of a repository to the manager's system repository.
    `protected void` | `cleanUpRepository(String repositoryID)` Clean up a removed repository.
    `protected Repository` | `createRepository(String id)` Creates and initializes the repository with the specified ID.
    `protected Repository` | `createSystemRepository()`
    `Collection<RepositoryInfo>` | `getAllRepositoryInfos(boolean skipSystemRepo)`
    `org.apache.http.client.HttpClient` | `getHttpClient()` `HttpClient` that has been assigned or has been used by this object.
    `Collection<Repository>` | `getInitializedRepositories()` Returns all initialized repositories.
    `Set<String>` | `getInitializedRepositoryIDs()` Returns all initialized repositories.
    `URL` | `getLocation()` Gets the URL of the server or directory.
    `String` | `getNewRepositoryID(String baseName)` Generates an ID for a new repository based on the specified base name.
    `Repository` | `getRepository(String id)` Gets the repository that is known by the specified ID from this manager.
    `RepositoryConfig` | `getRepositoryConfig(String repositoryID)`
    `Set<String>` | `getRepositoryIDs()`
    `RepositoryInfo` | `getRepositoryInfo(String id)` Gets the repository that is known by the specified ID from this manager.
    `Repository` | `getSystemRepository()` Gets the SYSTEM repository.
    `boolean` | `hasRepositoryConfig(String repositoryID)`
    `void` | `initialize()` Initializes the repository manager.
    `protected boolean` | `isCorrectType(RepositoryConfig repositoryConfig)`
    `protected boolean` | `isCorrectType(String repositoryID)`
    `void` | `refresh()` Shuts down all initialized user repositories.
    `boolean` | `removeRepositoryConfig(String repositoryID)` Deprecated.
    `void` | `setHttpClient(org.apache.http.client.HttpClient httpClient)` Should be called before `RepositoryManager.init()`.
    `void` | `shutDown()` Shuts down all initialized repositories, including the SYSTEM repository.

    - ### Methods inherited from class org.eclipse.rdf4j.repository.manager.RepositoryManager

      `getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getModelFactory, init, isInitialized, isSafeToRemove, removeRepository, setInitializedRepositories, setModelFactory, updateInitializedRepositories`

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

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

- - ### Constructor Detail

    - #### TypeFilteringRepositoryManager

          public TypeFilteringRepositoryManager(String type,
                                                RepositoryManager delegate)

  - ### Method Detail

    - #### 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`
      Specified by:
        `getHttpClient` in class `RepositoryManager`
      Returns:
        Returns the httpClient passed to `Repository` construction.
      See Also:
        `RepositoryManager.getHttpClient()`

    - #### setHttpClient

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

      Description copied from class: `RepositoryManager`
      Should be called before `RepositoryManager.init()`.
      Specified by:
        `setHttpClient` in interface `HttpClientDependent`
      Specified by:
        `setHttpClient` in class `RepositoryManager`
      Parameters:
        `httpClient` -
      See Also:
        `RepositoryManager.setHttpClient(org.apache.http.client.HttpClient)`

    - #### initialize

          public void initialize()
                          throws RepositoryException

      Description copied from class: `RepositoryManager`
      Initializes the repository manager.
      Overrides:
        `initialize` in class `RepositoryManager`
      Throws:
        `RepositoryException` - If the manager failed to initialize

    - #### getLocation

          public URL getLocation()
                          throws MalformedURLException

      Description copied from class: `RepositoryManager`
      Gets the URL of the server or directory.
      Specified by:
        `getLocation` in class `RepositoryManager`
      Throws:
        `MalformedURLException` - If the location cannot be represented as a URL.

    - #### createSystemRepository

          protected Repository createSystemRepository()
                                               throws RepositoryException

      Overrides:
        `createSystemRepository` in class `RepositoryManager`
      Throws:
        `RepositoryException`

    - #### getSystemRepository

          public Repository getSystemRepository()

      Description copied from class: `RepositoryManager`
      Gets the SYSTEM repository.
      Overrides:
        `getSystemRepository` in class `RepositoryManager`

    - #### getNewRepositoryID

          public String getNewRepositoryID(String baseName)
                                    throws RepositoryException,
                                           RepositoryConfigException

      Description copied from class: `RepositoryManager`
      Generates an ID for a new repository based on the specified base name. The base name may for example be a repository name entered by the user. The generated ID will contain a variant of this name that does not occur as a repository ID in this manager yet and is suitable for use as a file name (e.g. for the repository's data directory).
      Overrides:
        `getNewRepositoryID` in class `RepositoryManager`
      Parameters:
        `baseName` - The String on which the returned ID should be based, must not be `null`.
      Returns:
        A new repository ID derived from the specified base name.
      Throws:
        `RepositoryException`
        `RepositoryConfigException`

    - #### getRepositoryIDs

          public Set<String> getRepositoryIDs()
                                       throws RepositoryException

      Overrides:
        `getRepositoryIDs` in class `RepositoryManager`
      Throws:
        `RepositoryException`

    - #### hasRepositoryConfig

          public boolean hasRepositoryConfig(String repositoryID)
                                      throws RepositoryException,
                                             RepositoryConfigException

      Overrides:
        `hasRepositoryConfig` in class `RepositoryManager`
      Throws:
        `RepositoryException`
        `RepositoryConfigException`

    - #### getRepositoryConfig

          public RepositoryConfig getRepositoryConfig(String repositoryID)
                                               throws RepositoryConfigException,
                                                      RepositoryException

      Overrides:
        `getRepositoryConfig` in class `RepositoryManager`
      Throws:
        `RepositoryConfigException`
        `RepositoryException`

    - #### addRepositoryConfig

          public void addRepositoryConfig(RepositoryConfig config)
                                   throws RepositoryException,
                                          RepositoryConfigException

      Description copied from class: `RepositoryManager`
      Adds or updates the configuration of a repository to the manager's system repository. The system repository may already contain a configuration for a repository with the same ID as specified by `config`, in which case all previous configuration data for that repository will be cleared before the new configuration is added.
      Overrides:
        `addRepositoryConfig` in class `RepositoryManager`
      Parameters:
        `config` - The repository configuration that should be added to or updated in the system repository.
      Throws:
        `RepositoryException` - If the manager failed to update it's system repository.
        `RepositoryConfigException` - If the manager doesn't know how to update a configuration due to inconsistent configuration data in the system repository. For example, this happens when there are multiple existing configurations with the concerning ID.

    - #### removeRepositoryConfig

          @Deprecated
          public boolean removeRepositoryConfig(String repositoryID)
                                                     throws RepositoryException,
                                                            RepositoryConfigException

      Deprecated.
      Description copied from class: `RepositoryManager`
      Removes the configuration for the specified repository from the manager's system repository if such a configuration is present. Returns `true` if the system repository actually contained the specified repository configuration.
      Overrides:
        `removeRepositoryConfig` in class `RepositoryManager`
      Parameters:
        `repositoryID` - The ID of the repository whose configuration needs to be removed.
      Throws:
        `RepositoryException` - If the manager failed to update it's system repository.
        `RepositoryConfigException` - If the manager doesn't know how to remove a configuration due to inconsistent configuration data in the system repository. For example, this happens when there are multiple existing configurations with the concerning ID.

    - #### getRepository

          public Repository getRepository(String id)
                                   throws RepositoryConfigException,
                                          RepositoryException

      Description copied from class: `RepositoryManager`
      Gets the repository that is known by the specified ID from this manager.
      Specified by:
        `getRepository` in interface `RepositoryResolver`
      Overrides:
        `getRepository` in class `RepositoryManager`
      Parameters:
        `id` - A repository ID.
      Returns:
        An initialized Repository object, or `null` if no repository was known for the specified ID.
      Throws:
        `RepositoryConfigException` - If no repository could be created due to invalid or incomplete configuration data.
        `RepositoryException`

    - #### getInitializedRepositoryIDs

          public Set<String> getInitializedRepositoryIDs()

      Description copied from class: `RepositoryManager`
      Returns all initialized repositories. This method returns fast as no lazy creation of repositories takes place.
      Overrides:
        `getInitializedRepositoryIDs` in class `RepositoryManager`
      Returns:
        a collection containing the IDs of all initialized repositories.
      See Also:
        `RepositoryManager.getRepositoryIDs()`

    - #### getInitializedRepositories

          public Collection<Repository> getInitializedRepositories()

      Description copied from class: `RepositoryManager`
      Returns all initialized repositories. This method returns fast as no lazy creation of repositories takes place.
      Overrides:
        `getInitializedRepositories` in class `RepositoryManager`
      Returns:
        a set containing the initialized repositories.
      See Also:
        `RepositoryManager.getAllRepositories()`

    - #### createRepository

          protected Repository createRepository(String id)
                                         throws RepositoryConfigException,
                                                RepositoryException

      Description copied from class: `RepositoryManager`
      Creates and initializes the repository with the specified ID.
      Specified by:
        `createRepository` in class `RepositoryManager`
      Parameters:
        `id` - A repository ID.
      Returns:
        The created and initialized repository, or `null` if no such repository exists.
      Throws:
        `RepositoryConfigException` - If no repository could be created due to invalid or incomplete configuration data.
        `RepositoryException` - If the repository could not be initialized.

    - #### getAllRepositoryInfos

          public Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo)
                                                           throws RepositoryException

      Specified by:
        `getAllRepositoryInfos` in class `RepositoryManager`
      Throws:
        `RepositoryException` - When not able to retrieve existing configurations

    - #### getRepositoryInfo

          public RepositoryInfo getRepositoryInfo(String id)
                                           throws RepositoryException

      Description copied from class: `RepositoryManager`
      Gets the repository that is known by the specified ID from this manager.
      Overrides:
        `getRepositoryInfo` in class `RepositoryManager`
      Parameters:
        `id` - A repository ID.
      Returns:
        A Repository object, or `null` if no repository was known for the specified ID.
      Throws:
        `RepositoryException` - When not able to retrieve existing configurations

    - #### refresh

          public void refresh()

      Description copied from class: `RepositoryManager`
      Shuts down all initialized user repositories.
      Overrides:
        `refresh` in class `RepositoryManager`
      See Also:
        `RepositoryManager.shutDown()`

    - #### shutDown

          public void shutDown()

      Description copied from class: `RepositoryManager`
      Shuts down all initialized repositories, including the SYSTEM repository.
      Overrides:
        `shutDown` in class `RepositoryManager`
      See Also:
        `RepositoryManager.refresh()`

    - #### cleanUpRepository

          protected void cleanUpRepository(String repositoryID)
                                    throws IOException

      Description copied from class: `RepositoryManager`
      Clean up a removed repository. Note that the configuration for this repository is no longer present in the system repository.
      Overrides:
        `cleanUpRepository` in class `RepositoryManager`
      Parameters:
        `repositoryID` - the ID of the repository to clean up
      Throws:
        `IOException`

    - #### isCorrectType

          protected boolean isCorrectType(String repositoryID)
                                   throws RepositoryConfigException,
                                          RepositoryException

      Throws:
        `RepositoryConfigException`
        `RepositoryException`

    - #### isCorrectType

          protected boolean isCorrectType(RepositoryConfig repositoryConfig)

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