public class RepositoryWrapper extends Object implements DelegatingRepository
DelegatingRepository implementation that, by default, forwards all method calls to its delegate.| Constructor and Description |
|---|
RepositoryWrapper()
Creates a new RepositoryWrapper.
|
RepositoryWrapper(Repository delegate)
Creates a new RepositoryWrapper and calls
setDelegate(Repository) with the supplied delegate
repository. |
| Modifier and Type | Method and Description |
|---|---|
RepositoryConnection |
getConnection()
Opens a connection to this repository that can be used for querying and updating the contents of the repository.
|
File |
getDataDir()
Get the directory where data and logging for this repository is stored.
|
Repository |
getDelegate() |
ValueFactory |
getValueFactory()
Gets a ValueFactory for this Repository.
|
void |
initialize()
Initializes this repository.
|
boolean |
isInitialized()
Indicates if the Repository has been initialized.
|
boolean |
isWritable()
Checks whether this repository is writable, i.e.
|
void |
setDataDir(File dataDir)
Set the directory where data and logging for this repository is stored.
|
void |
setDelegate(Repository delegate) |
void |
shutDown()
Shuts the repository down, releasing any resources that it keeps hold of.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinitpublic RepositoryWrapper()
public RepositoryWrapper(Repository delegate)
setDelegate(Repository) with the supplied delegate
repository.public void setDelegate(Repository delegate)
setDelegate in interface DelegatingRepositorypublic Repository getDelegate()
getDelegate in interface DelegatingRepositorypublic void setDataDir(File dataDir)
RepositorysetDataDir in interface RepositorydataDir - the directory where data for this repository is storedpublic File getDataDir()
RepositorygetDataDir in interface Repositorypublic void initialize()
throws RepositoryException
Repositoryinitialize in interface RepositoryRepositoryException - If the initialization failed.public void shutDown()
throws RepositoryException
RepositoryshutDown in interface RepositoryRepositoryExceptionpublic boolean isWritable()
throws RepositoryException
RepositoryisWritable in interface RepositoryRepositoryExceptionpublic RepositoryConnection getConnection() throws RepositoryException
Repository
try (RepositoryConnection conn = repository.getConnection()) {
// perform operations on the connection
}
Note that RepositoryConnection is 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 own RepositoryConnections.getConnection in interface RepositoryRepositoryException - If something went wrong during the creation of the Connection.public ValueFactory getValueFactory()
RepositorygetValueFactory in interface Repositorypublic boolean isInitialized()
RepositoryisInitialized in interface RepositoryCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.