Class RepositoryConfigRepository
- java.lang.Object
-
- org.eclipse.rdf4j.repository.base.AbstractRepository
-
- org.eclipse.rdf4j.http.server.repository.RepositoryConfigRepository
-
- All Implemented Interfaces:
Repository
public class RepositoryConfigRepository extends AbstractRepository
- Author:
- James Leigh
-
-
Field Summary
Fields Modifier and Type Field Description static StringIDThe repository identifier for the system repository that contains the configuration data.-
Fields inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository
logger
-
-
Constructor Summary
Constructors Constructor Description RepositoryConfigRepository(RepositoryManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryConnectiongetConnection()Opens a connection to this repository that can be used for querying and updating the contents of the repository.FilegetDataDir()Get the directory where data and logging for this repository is stored.ValueFactorygetValueFactory()Gets a ValueFactory for this Repository.protected voidinitializeInternal()booleanisWritable()Checks whether this repository is writable, i.e.voidsetDataDir(File dataDir)Set the directory where data and logging for this repository is stored.protected voidshutDownInternal()-
Methods inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository
init, isInitialized, shutDown
-
-
-
-
Field Detail
-
ID
public static final String ID
The repository identifier for the system repository that contains the configuration data.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RepositoryConfigRepository
public RepositoryConfigRepository(RepositoryManager manager)
-
-
Method Detail
-
setDataDir
public void setDataDir(File dataDir)
Description copied from interface:RepositorySet the directory where data and logging for this repository is stored.- Parameters:
dataDir- the directory where data for this repository is stored
-
getDataDir
public File getDataDir()
Description copied from interface:RepositoryGet the directory where data and logging for this repository is stored.- Returns:
- the directory where data for this repository is stored.
-
isWritable
public boolean isWritable() throws RepositoryExceptionDescription copied from interface:RepositoryChecks whether this repository is writable, i.e. if the data contained in this repository can be changed. The writability of the repository is determined by the writability of the Sail that this repository operates on.- Throws:
RepositoryException
-
getValueFactory
public ValueFactory getValueFactory()
Description copied from interface:RepositoryGets a ValueFactory for this Repository.- Returns:
- A repository-specific ValueFactory.
-
initializeInternal
protected void initializeInternal() throws RepositoryException- Specified by:
initializeInternalin classAbstractRepository- Throws:
RepositoryException
-
shutDownInternal
protected void shutDownInternal() throws RepositoryException- Specified by:
shutDownInternalin classAbstractRepository- Throws:
RepositoryException
-
getConnection
public RepositoryConnection getConnection() throws RepositoryException
Description copied from interface:RepositoryOpens a connection to this repository that can be used for querying and updating the contents of the repository. Created connections need to be closed to make sure that any resources they keep hold of are released. The best way to do this is to use a try-with-resources block, as follows:try (RepositoryConnection conn = repository.getConnection()) { // perform operations on the connection }Note that
RepositoryConnectionis not guaranteed to be thread-safe! The recommended pattern for repository access in a multi-threaded application is to share the Repository object between threads, but have each thread create and use its ownRepositoryConnections.- Returns:
- A connection that allows operations on this repository.
- Throws:
RepositoryException- If something went wrong during the creation of the Connection.
-
-