public class RemoteRepositoryManager extends RepositoryManager
Repository
s 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, updateInitializedRepositories
public RemoteRepositoryManager(String serverURL)
serverURL
- The URL of the server.public static RemoteRepositoryManager getInstance(String serverURL) throws RepositoryException
RemoteRepositoryManager
with the specified server URL.RepositoryException
public static RemoteRepositoryManager getInstance(String serverURL, String username, String password) throws RepositoryException
RemoteRepositoryManager
with the specified server URL and credentials.RepositoryException
protected SharedHttpClientSessionManager getSharedHttpClientSessionManager()
SharedHttpClientSessionManager
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 protocolSession)
RepositoryManager
RepositoryManager.init()
.setHttpClient
in interface HttpClientDependent
setHttpClient
in class RepositoryManager
protocolSession
- The httpClient to use for remote/service calls.public void shutDown()
RepositoryManager
shutDown
in class RepositoryManager
RepositoryManager.refresh()
public void setUsernameAndPassword(String username, String password)
username
- the usernamepassword
- the password@Deprecated protected Repository createSystemRepository() throws RepositoryException
createSystemRepository
in class RepositoryManager
RepositoryException
public URL getLocation() throws MalformedURLException
getLocation
in class RepositoryManager
MalformedURLException
- If serverURL cannot be parsedpublic String getServerURL()
protected Repository createRepository(String id) throws RepositoryConfigException, RepositoryException
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) throws RepositoryException
getRepositoryConfig
in class RepositoryManager
RepositoryException
public Collection<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.