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
.logger
Constructor and Description |
---|
RemoteRepositoryManager(String serverURL)
Creates a new RepositoryManager that operates on the specified base
directory.
|
Modifier and Type | Method and Description |
---|---|
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) |
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.
|
RepositoryInfo |
getRepositoryInfo(String id)
Gets the repository that is known by the specified ID from this manager.
|
String |
getServerURL()
Gets the URL of the remote server, e.g.
|
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 |
setUsernameAndPassword(String username,
String password)
Set the username and password for authenication with the remote server.
|
addRepositoryConfig, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getInitializedRepositoryIDs, getNewRepositoryID, getRepository, getRepositoryConfig, getRepositoryIDs, getSystemRepository, hasRepositoryConfig, initialize, isInitialized, isSafeToRemove, refresh, removeRepositoryConfig, shutDown
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
public void setUsernameAndPassword(String username, String password)
username
- the usernamepassword
- the passwordprotected 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 RepositoryInfo getRepositoryInfo(String id) throws RepositoryException
RepositoryManager
getRepositoryInfo
in class RepositoryManager
id
- A repository ID.RepositoryException
- When not able to retrieve existing configurationspublic Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo) throws RepositoryException
getAllRepositoryInfos
in class RepositoryManager
RepositoryException
- When not able to retrieve existing configurationspublic 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.protected void cleanUpRepository(String repositoryID) throws IOException
RepositoryManager
cleanUpRepository
in class RepositoryManager
repositoryID
- the ID of the repository to clean upIOException
Copyright © 2001-2016 Aduna. All Rights Reserved.