org.openrdf.repository.manager
Class RemoteRepositoryManager

java.lang.Object
  extended by org.openrdf.repository.manager.RepositoryManager
      extended by org.openrdf.repository.manager.RemoteRepositoryManager

public class RemoteRepositoryManager
extends RepositoryManager

A manager for 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.

Author:
Arjohn Kampman

Field Summary
 
Fields inherited from class org.openrdf.repository.manager.RepositoryManager
logger
 
Constructor Summary
RemoteRepositoryManager(String serverURL)
          Creates a new RepositoryManager that operates on the specified base directory.
 
Method Summary
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.
 void setUsernameAndPassword(String username, String password)
          Set the username and password for authenication with the remote server.
 
Methods inherited from class org.openrdf.repository.manager.RepositoryManager
addRepositoryConfig, getAllRepositories, getAllRepositoryInfos, getAllUserRepositoryInfos, getInitializedRepositories, getInitializedRepositoryIDs, getNewRepositoryID, getRepository, getRepositoryConfig, getRepositoryIDs, getSystemRepository, hasRepositoryConfig, initialize, refresh, removeRepositoryConfig, shutDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteRepositoryManager

public RemoteRepositoryManager(String serverURL)
Creates a new RepositoryManager that operates on the specified base directory.

Parameters:
serverURL - The URL of the server.
Method Detail

getInstance

public static RemoteRepositoryManager getInstance(String serverURL)
                                           throws RepositoryException
Creates an initialized RemoteRepositoryManager with the specified server URL.

Throws:
RepositoryException

getInstance

public static RemoteRepositoryManager getInstance(String serverURL,
                                                  String username,
                                                  String password)
                                           throws RepositoryException
Creates an initialized RemoteRepositoryManager with the specified server URL and credentials.

Throws:
RepositoryException

setUsernameAndPassword

public void setUsernameAndPassword(String username,
                                   String password)
Set the username and password for authenication with the remote server.

Parameters:
username - the username
password - the password

createSystemRepository

protected Repository createSystemRepository()
                                     throws RepositoryException
Specified by:
createSystemRepository in class RepositoryManager
Throws:
RepositoryException

getLocation

public URL getLocation()
                throws MalformedURLException
Gets the URL of the remote server, e.g. "http://localhost:8080/openrdf-sesame/".

Specified by:
getLocation in class RepositoryManager
Throws:
MalformedURLException - If serverURL cannot be parsed

getServerURL

public String getServerURL()
Gets the URL of the remote server, e.g. "http://localhost:8080/openrdf-sesame/".


createRepository

protected Repository createRepository(String id)
                               throws RepositoryConfigException,
                                      RepositoryException
Creates and initializes the repository with the specified ID.

Specified by:
createRepository in class RepositoryManager
Parameters:
id - A repository ID.
Returns:
The created repository, or null if no such repository exists.
Throws:
RepositoryConfigException - If no repository could be created due to invalid or incomplete configuration data.
RepositoryException

getRepositoryInfo

public RepositoryInfo getRepositoryInfo(String id)
                                 throws RepositoryException
Description copied from class: RepositoryManager
Gets the repository that is known by the specified ID from this manager.

Specified by:
getRepositoryInfo in class RepositoryManager
Parameters:
id - A repository ID.
Returns:
A Repository object, or null if no repository was known for the specified ID.
Throws:
RepositoryException - When not able to retrieve existing configurations

getAllRepositoryInfos

public Collection<RepositoryInfo> getAllRepositoryInfos(boolean skipSystemRepo)
                                                 throws RepositoryException
Specified by:
getAllRepositoryInfos in class RepositoryManager
Throws:
RepositoryException - When not able to retrieve existing configurations

cleanUpRepository

protected void cleanUpRepository(String repositoryID)
                          throws IOException
Description copied from class: RepositoryManager
Clean up a removed repository. Note that the configuration for this repository is no longer present in the system repository.

Specified by:
cleanUpRepository in class RepositoryManager
Parameters:
repositoryID - the ID of the repository to clean up
Throws:
IOException


Copyright © 2001-2012 Aduna. All Rights Reserved.