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| 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) |
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.
|
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.
|
protected SesameClient |
getSesameClient() |
void |
initialize()
Initializes the repository manager.
|
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 httpClient)
Should be called before
RepositoryManager.initialize(). |
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.
|
addRepositoryConfig, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getInitializedRepositoryIDs, getNewRepositoryID, getRepository, getRepositoryConfig, getRepositoryIDs, getSystemRepository, hasRepositoryConfig, isInitialized, isSafeToRemove, refresh, removeRepositoryConfig, setInitializedRepositories, 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 SesameClient getSesameClient()
public 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 httpClient)
RepositoryManagerRepositoryManager.initialize().setHttpClient in interface HttpClientDependentsetHttpClient in class RepositoryManagerhttpClient - The httpClient to use for remote/service calls.public void initialize()
throws RepositoryException
RepositoryManagerinitialize in class RepositoryManagerRepositoryException - If the manager failed to initialize the SYSTEM repository.public void shutDown()
RepositoryManagershutDown in class RepositoryManagerRepositoryManager.refresh()public void setUsernameAndPassword(String username, String password)
username - the usernamepassword - the passwordprotected 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 RepositoryInfo getRepositoryInfo(String id) throws RepositoryException
RepositoryManagergetRepositoryInfo in class RepositoryManagerid - A repository ID.RepositoryException - When not able to retrieve existing configurationspublic Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo) throws RepositoryException
getAllRepositoryInfos in class RepositoryManagerRepositoryException - When not able to retrieve existing configurationspublic 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.protected void cleanUpRepository(String repositoryID) throws IOException
RepositoryManagercleanUpRepository in class RepositoryManagerrepositoryID - the ID of the repository to clean upIOExceptionCopyright © 2001–2015 Aduna. All rights reserved.