public class RemoteRepositoryManager extends RepositoryManager
Repositorys that reside on a remote server. This repository manager allows one to access
repositories over HTTP similar to how local repositories are accessed using the LocalRepositoryManager.initializedRepositories, logger, NAMESPACE, PROXIED_ID| Constructor and Description |
|---|
RemoteRepositoryManager(String serverURL)
Creates a new RepositoryManager that operates on the specified 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 Repository |
createSystemRepository()
Deprecated.
|
Collection<RepositoryInfo> |
getAllRepositoryInfos(boolean skipSystemRepo) |
org.apache.http.client.HttpClient |
getHttpClient()
HttpClient that has been assigned or has been used by this object. |
static RemoteRepositoryManager |
getInstance(String serverURL)
Creates an initialized
RemoteRepositoryManager with the specified server URL. |
static RemoteRepositoryManager |
getInstance(String serverURL,
String username,
String password)
Creates an initialized
RemoteRepositoryManager with the specified server URL and credentials. |
URL |
getLocation()
Gets the URL of the remote server, e.g.
|
RepositoryConfig |
getRepositoryConfig(String id) |
String |
getServerURL()
Gets the URL of the remote server, e.g.
|
protected SharedHttpClientSessionManager |
getSharedHttpClientSessionManager() |
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.
|
void |
setHttpClient(org.apache.http.client.HttpClient protocolSession)
Should be called before
RepositoryManager.init(). |
void |
setUsernameAndPassword(String username,
String password)
Set the username and password for authenication with the remote server.
|
void |
shutDown()
Shuts down all initialized repositories, including the SYSTEM repository.
|
cleanUpRepository, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getInitializedRepositoryIDs, getModelFactory, getNewRepositoryID, getRepository, getRepositoryIDs, getRepositoryInfo, getSystemRepository, hasRepositoryConfig, init, initialize, isInitialized, isSafeToRemove, refresh, removeRepositoryConfig, setInitializedRepositories, setModelFactory, updateInitializedRepositoriespublic RemoteRepositoryManager(String serverURL)
serverURL - The URL of the server.public static RemoteRepositoryManager getInstance(String serverURL) throws RepositoryException
RemoteRepositoryManager with the specified server URL.RepositoryExceptionpublic static RemoteRepositoryManager getInstance(String serverURL, String username, String password) throws RepositoryException
RemoteRepositoryManager with the specified server URL and credentials.RepositoryExceptionprotected SharedHttpClientSessionManager getSharedHttpClientSessionManager()
SharedHttpClientSessionManagerpublic org.apache.http.client.HttpClient getHttpClient()
HttpClientDependentHttpClient 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 HttpClientDependentgetHttpClient in class RepositoryManagerRepository construction.public void setHttpClient(org.apache.http.client.HttpClient protocolSession)
RepositoryManagerRepositoryManager.init().setHttpClient in interface HttpClientDependentsetHttpClient in class RepositoryManagerprotocolSession - The httpClient to use for remote/service calls.public void shutDown()
RepositoryManagershutDown in class RepositoryManagerRepositoryManager.refresh()public void setUsernameAndPassword(String username, String password)
username - the usernamepassword - the password@Deprecated protected Repository createSystemRepository() throws RepositoryException
createSystemRepository in class RepositoryManagerRepositoryExceptionpublic URL getLocation() throws MalformedURLException
getLocation in class RepositoryManagerMalformedURLException - If serverURL cannot be parsedpublic String getServerURL()
protected Repository createRepository(String id) throws RepositoryConfigException, RepositoryException
createRepository in class RepositoryManagerid - 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) throws RepositoryException
getRepositoryConfig in class RepositoryManagerRepositoryExceptionpublic Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo) throws RepositoryException
getAllRepositoryInfos in class RepositoryManagerRepositoryException - When not able to retrieve existing configurationspublic void addRepositoryConfig(RepositoryConfig config) throws RepositoryException, RepositoryConfigException
RepositoryManageraddRepositoryConfig in class RepositoryManagerconfig - 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
RepositoryManagerremoveRepository in class RepositoryManagerrepositoryID - 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-2020 Eclipse Foundation. All Rights Reserved.