public class TypeFilteringRepositoryManager extends RepositoryManager
initializedRepositories, logger, NAMESPACE, PROXIED_ID
Constructor and Description |
---|
TypeFilteringRepositoryManager(String type,
RepositoryManager delegate) |
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.
|
getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getModelFactory, init, isInitialized, isSafeToRemove, removeRepository, setInitializedRepositories, setModelFactory, updateInitializedRepositories
public TypeFilteringRepositoryManager(String type, RepositoryManager delegate)
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.RepositoryManager.getHttpClient()
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
RepositoryManager
RepositoryManager.init()
.setHttpClient
in interface HttpClientDependent
setHttpClient
in class RepositoryManager
httpClient
- RepositoryManager.setHttpClient(org.apache.http.client.HttpClient)
public void initialize() throws RepositoryException
RepositoryManager
initialize
in class RepositoryManager
RepositoryException
- If the manager failed to initializepublic URL getLocation() throws MalformedURLException
RepositoryManager
getLocation
in class RepositoryManager
MalformedURLException
- If the location cannot be represented as a URL.protected Repository createSystemRepository() throws RepositoryException
createSystemRepository
in class RepositoryManager
RepositoryException
public Repository getSystemRepository()
RepositoryManager
getSystemRepository
in class RepositoryManager
public String getNewRepositoryID(String baseName) throws RepositoryException, RepositoryConfigException
RepositoryManager
getNewRepositoryID
in class RepositoryManager
baseName
- The String on which the returned ID should be based, must not be null.RepositoryException
RepositoryConfigException
public Set<String> getRepositoryIDs() throws RepositoryException
getRepositoryIDs
in class RepositoryManager
RepositoryException
public boolean hasRepositoryConfig(String repositoryID) throws RepositoryException, RepositoryConfigException
hasRepositoryConfig
in class RepositoryManager
RepositoryException
RepositoryConfigException
public RepositoryConfig getRepositoryConfig(String repositoryID) throws RepositoryConfigException, RepositoryException
getRepositoryConfig
in class RepositoryManager
RepositoryConfigException
RepositoryException
public 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.@Deprecated public boolean removeRepositoryConfig(String repositoryID) throws RepositoryException, RepositoryConfigException
RepositoryManager
removeRepositoryConfig
in class RepositoryManager
repositoryID
- The ID of the repository whose configuration needs to be removed.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.public Repository getRepository(String id) throws RepositoryConfigException, RepositoryException
RepositoryManager
getRepository
in interface RepositoryResolver
getRepository
in class RepositoryManager
id
- A repository ID.RepositoryConfigException
- If no repository could be created due to invalid or incomplete configuration
data.RepositoryException
public Set<String> getInitializedRepositoryIDs()
RepositoryManager
getInitializedRepositoryIDs
in class RepositoryManager
RepositoryManager.getRepositoryIDs()
public Collection<Repository> getInitializedRepositories()
RepositoryManager
getInitializedRepositories
in class RepositoryManager
RepositoryManager.getAllRepositories()
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 Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo) throws RepositoryException
getAllRepositoryInfos
in class RepositoryManager
RepositoryException
- When not able to retrieve existing configurationspublic RepositoryInfo getRepositoryInfo(String id) throws RepositoryException
RepositoryManager
getRepositoryInfo
in class RepositoryManager
id
- A repository ID.RepositoryException
- When not able to retrieve existing configurationspublic void refresh()
RepositoryManager
refresh
in class RepositoryManager
RepositoryManager.shutDown()
public void shutDown()
RepositoryManager
shutDown
in class RepositoryManager
RepositoryManager.refresh()
protected void cleanUpRepository(String repositoryID) throws IOException
RepositoryManager
cleanUpRepository
in class RepositoryManager
repositoryID
- the ID of the repository to clean upIOException
protected boolean isCorrectType(String repositoryID) throws RepositoryConfigException, RepositoryException
protected boolean isCorrectType(RepositoryConfig repositoryConfig)
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.