org.openrdf.repository.base
Class RepositoryWrapper

java.lang.Object
  extended by org.openrdf.repository.base.RepositoryWrapper
All Implemented Interfaces:
DelegatingRepository, Repository
Direct Known Subclasses:
ContextAwareRepository, InterceptingRepositoryWrapper, NotifyingRepositoryWrapper

public class RepositoryWrapper
extends Object
implements DelegatingRepository

A DelegatingRepository implementation that, by default, forwards all method calls to its delegate.

Author:
Herko ter Horst, Arjohn Kampman

Constructor Summary
RepositoryWrapper()
          Creates a new RepositoryWrapper.
RepositoryWrapper(Repository delegate)
          Creates a new RepositoryWrapper and calls setDelegate(Repository) with the supplied delegate repository.
 
Method Summary
 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()
           
 LiteralFactory getLiteralFactory()
          Gets a LiteralFactory for this Repository.
 RepositoryMetaData getMetaData()
           
 URIFactory getURIFactory()
          Gets a URIFactory for this Repository.
 ValueFactory getValueFactory()
          Gets a ValueFactory for this Repository.
 void initialize()
          Initializes this repository.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryWrapper

public RepositoryWrapper()
Creates a new RepositoryWrapper.


RepositoryWrapper

public RepositoryWrapper(Repository delegate)
Creates a new RepositoryWrapper and calls setDelegate(Repository) with the supplied delegate repository.

Method Detail

setDelegate

public void setDelegate(Repository delegate)
Specified by:
setDelegate in interface DelegatingRepository

getDelegate

public Repository getDelegate()
Specified by:
getDelegate in interface DelegatingRepository

getMetaData

public RepositoryMetaData getMetaData()
                               throws StoreException
Specified by:
getMetaData in interface Repository
Throws:
StoreException

setDataDir

public void setDataDir(File dataDir)
Description copied from interface: Repository
Set the directory where data and logging for this repository is stored.

Specified by:
setDataDir in interface Repository
Parameters:
dataDir - the directory where data for this repository is stored

getDataDir

public File getDataDir()
Description copied from interface: Repository
Get the directory where data and logging for this repository is stored.

Specified by:
getDataDir in interface Repository
Returns:
the directory where data for this repository is stored.

initialize

public void initialize()
                throws StoreException
Description copied from interface: Repository
Initializes this repository. A repository needs to be initialized before it can be used.

Specified by:
initialize in interface Repository
Throws:
StoreException - If the initialization failed.

shutDown

public void shutDown()
              throws StoreException
Description copied from interface: Repository
Shuts the repository down, releasing any resources that it keeps hold of. Once shut down, the repository can no longer be used until it is re-initialized.

Specified by:
shutDown in interface Repository
Throws:
StoreException

getConnection

public RepositoryConnection getConnection()
                                   throws StoreException
Description copied from interface: Repository
Opens 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-finally-block as follows:
 Connection con = repository.getConnection();
 try {
        // perform operations on the connection
 }
 finally {
        con.close();
 }
 

Specified by:
getConnection in interface Repository
Returns:
A connection that allows operations on this repository.
Throws:
StoreException - If something went wrong during the creation of the Connection.

getLiteralFactory

public LiteralFactory getLiteralFactory()
Description copied from interface: Repository
Gets a LiteralFactory for this Repository.

Specified by:
getLiteralFactory in interface Repository
Returns:
A repository-specific LiteralFactory.

getURIFactory

public URIFactory getURIFactory()
Description copied from interface: Repository
Gets a URIFactory for this Repository.

Specified by:
getURIFactory in interface Repository
Returns:
A repository-specific URIFactory.

getValueFactory

public ValueFactory getValueFactory()
Description copied from interface: Repository
Gets a ValueFactory for this Repository.

Specified by:
getValueFactory in interface Repository
Returns:
A repository-specific ValueFactory.


Copyright © 2001-2009 Aduna. All Rights Reserved.