public class LocalRepositoryManager extends RepositoryManager
RepositoryManager
interface that operates directly on the repository data files in
the local file system.Modifier and Type | Field and Description |
---|---|
static String |
REPOSITORIES_DIR |
initializedRepositories, logger, NAMESPACE, PROXIED_ID
Constructor and Description |
---|
LocalRepositoryManager(File baseDir)
Creates a new RepositoryManager that operates on the specfified base directory.
|
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 Repository |
createRepository(String id)
Creates and initializes the repository with the specified ID.
|
protected SystemRepository |
createSystemRepository()
Deprecated.
|
List<RepositoryInfo> |
getAllRepositoryInfos(boolean skipSystemRepo) |
File |
getBaseDir()
Gets the base dir against which to resolve relative paths.
|
protected FederatedServiceResolver |
getFederatedServiceResolver() |
org.apache.http.client.HttpClient |
getHttpClient()
HttpClient that has been assigned or has been used by this object. |
URL |
getLocation()
Gets the base dir against which to resolve relative paths.
|
RepositoryConfig |
getRepositoryConfig(String id) |
File |
getRepositoryDir(String repositoryID) |
RepositoryInfo |
getRepositoryInfo(String id)
Gets the repository that is known by the specified ID from this manager.
|
protected SharedHttpClientSessionManager |
getSesameClient() |
SystemRepository |
getSystemRepository()
Deprecated.
|
boolean |
removeRepository(String repositoryID)
Removes the specified repository by deleting its configuration from the manager's system repository if such a
configuration is present, and removing any persistent data associated with the repository.
|
File |
resolvePath(String path)
Resolves the specified path against the manager's base directory.
|
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.
|
cleanUpRepository, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getInitializedRepositoryIDs, getModelFactory, getNewRepositoryID, getRepository, getRepositoryIDs, hasRepositoryConfig, init, initialize, isInitialized, isSafeToRemove, refresh, removeRepositoryConfig, setInitializedRepositories, setModelFactory, updateInitializedRepositories
public static final String REPOSITORIES_DIR
public LocalRepositoryManager(File baseDir)
baseDir
- The base directory where data for repositories can be stored, among other things.@Deprecated protected SystemRepository createSystemRepository() throws RepositoryException
createSystemRepository
in class RepositoryManager
RepositoryException
public File getBaseDir()
public URL getLocation() throws MalformedURLException
getLocation
in class RepositoryManager
MalformedURLException
- If the path cannot be parsed as a URLprotected SharedHttpClientSessionManager getSesameClient()
public org.apache.http.client.HttpClient getHttpClient()
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.getHttpClient
in interface HttpClientDependent
getHttpClient
in class RepositoryManager
Repository
construction.public void setHttpClient(org.apache.http.client.HttpClient httpClient)
RepositoryManager
RepositoryManager.init()
.setHttpClient
in interface HttpClientDependent
setHttpClient
in class RepositoryManager
httpClient
- The httpClient to use for remote/service calls.protected FederatedServiceResolver getFederatedServiceResolver()
public void shutDown()
RepositoryManager
shutDown
in class RepositoryManager
RepositoryManager.refresh()
public File resolvePath(String path)
getBaseDir()
@Deprecated public SystemRepository getSystemRepository()
RepositoryManager
getSystemRepository
in class RepositoryManager
protected Repository createRepository(String id) throws RepositoryConfigException, RepositoryException
RepositoryManager
createRepository
in class RepositoryManager
id
- A repository ID.RepositoryConfigException
- If no repository could be created due to invalid or incomplete configuration
data.RepositoryException
- If the repository could not be initialized.public RepositoryConfig getRepositoryConfig(String id)
getRepositoryConfig
in class RepositoryManager
public RepositoryInfo getRepositoryInfo(String id)
RepositoryManager
getRepositoryInfo
in class RepositoryManager
id
- A repository ID.public List<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo) throws RepositoryException
getAllRepositoryInfos
in class RepositoryManager
RepositoryException
- When not able to retrieve existing configurationspublic void addRepositoryConfig(RepositoryConfig config) throws RepositoryException, RepositoryConfigException
RepositoryManager
addRepositoryConfig
in class RepositoryManager
config
- The repository configuration that should be added to or updated in the system repository.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.public boolean removeRepository(String repositoryID) throws RepositoryException, RepositoryConfigException
RepositoryManager
removeRepository
in class RepositoryManager
repositoryID
- The ID of the repository that needs to be removed.RepositoryException
- If the manager failed to update its system repository.RepositoryConfigException
- If the manager doesn't know how to remove a repository due to inconsistent
configuration data in the system repository. For example, this happens when
there are multiple existing configurations with the concerning ID.Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.