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, wait
init
public RepositoryWrapper()
public RepositoryWrapper(Repository delegate)
setDelegate(Repository)
with the supplied delegate
repository.public void setDelegate(Repository delegate)
setDelegate
in interface DelegatingRepository
public Repository getDelegate()
getDelegate
in interface DelegatingRepository
public void setDataDir(File dataDir)
Repository
setDataDir
in interface Repository
dataDir
- the directory where data for this repository is storedpublic File getDataDir()
Repository
getDataDir
in interface Repository
public void initialize() throws RepositoryException
Repository
initialize
in interface Repository
RepositoryException
- If the initialization failed.public void shutDown() throws RepositoryException
Repository
shutDown
in interface Repository
RepositoryException
public boolean isWritable() throws RepositoryException
Repository
isWritable
in interface Repository
RepositoryException
public 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 RepositoryConnection
s.getConnection
in interface Repository
RepositoryException
- If something went wrong during the creation of the Connection.public ValueFactory getValueFactory()
Repository
getValueFactory
in interface Repository
public boolean isInitialized()
Repository
isInitialized
in interface Repository
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.