Class FedXRepositoryWrapper
- java.lang.Object
-
- org.eclipse.rdf4j.repository.base.RepositoryWrapper
-
- org.eclipse.rdf4j.federated.repository.FedXRepositoryWrapper
-
- All Implemented Interfaces:
FederatedServiceResolverClient
,DelegatingRepository
,Repository
,RepositoryResolverClient
public class FedXRepositoryWrapper extends RepositoryWrapper implements RepositoryResolverClient, FederatedServiceResolverClient
Wrapper for theFedXRepository
in order to allow for lazy initialization.The wrapper is used from
FedXRepositoryFactory
in environments with aRepositoryManager
, e.g. in the RDF4J workbench. The background is that the RDF4J repository manager requires control over the repository instance.The data directory and the
RepositoryResolver
are handled by RDF4JRepositoryManager
.- Author:
- Andreas Schwarte
- See Also:
FedXFactory
-
-
Constructor Summary
Constructors Constructor Description FedXRepositoryWrapper(FedXRepositoryConfig fedXConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FedXFactory
createFactory()
Create the initializedFedXFactory
File
getDataDir()
Get the directory where data and logging for this repository is stored.void
init()
Initializes this repository.boolean
isInitialized()
Indicates if the Repository has been initialized.void
setDataDir(File dataDir)
Set the directory where data and logging for this repository is stored.void
setFederatedServiceResolver(FederatedServiceResolver resolver)
Sets theFederatedServiceResolver
to use for this client.void
setRepositoryResolver(RepositoryResolver resolver)
void
shutDown()
Shuts the repository down, releasing any resources that it keeps hold of.-
Methods inherited from class org.eclipse.rdf4j.repository.base.RepositoryWrapper
getConnection, getDelegate, getValueFactory, isWritable, setDelegate, toString
-
-
-
-
Constructor Detail
-
FedXRepositoryWrapper
public FedXRepositoryWrapper(FedXRepositoryConfig fedXConfig)
-
-
Method Detail
-
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 interfaceRepository
- Overrides:
setDataDir
in classRepositoryWrapper
- 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 interfaceRepository
- Overrides:
getDataDir
in classRepositoryWrapper
- Returns:
- the directory where data for this repository is stored.
-
isInitialized
public boolean isInitialized()
Description copied from interface:Repository
Indicates if the Repository has been initialized. Note that the initialization status may change if the Repository is shut down.- Specified by:
isInitialized
in interfaceRepository
- Overrides:
isInitialized
in classRepositoryWrapper
- Returns:
- true iff the repository has been initialized.
-
init
public void init() throws RepositoryException
Description copied from interface:Repository
Initializes this repository. A repository needs to be initialized before it can be used, however explicitly calling this method is not necessary: the repository will automatically initialize itself if an operation is executed on it that requires it to be initialized.- Specified by:
init
in interfaceRepository
- Overrides:
init
in classRepositoryWrapper
- Throws:
RepositoryException
- If the initialization failed.
-
createFactory
protected FedXFactory createFactory()
Create the initializedFedXFactory
- Returns:
-
shutDown
public void shutDown() throws RepositoryException
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 interfaceRepository
- Overrides:
shutDown
in classRepositoryWrapper
- Throws:
RepositoryException
-
setRepositoryResolver
public void setRepositoryResolver(RepositoryResolver resolver)
- Specified by:
setRepositoryResolver
in interfaceRepositoryResolverClient
-
setFederatedServiceResolver
public void setFederatedServiceResolver(FederatedServiceResolver resolver)
Description copied from interface:FederatedServiceResolverClient
Sets theFederatedServiceResolver
to use for this client.- Specified by:
setFederatedServiceResolver
in interfaceFederatedServiceResolverClient
- Parameters:
resolver
- The resolver to use.
-
-