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 theFedXRepositoryin order to allow for lazy initialization.The wrapper is used from
FedXRepositoryFactoryin 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
RepositoryResolverare 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 FedXFactorycreateFactory()Create the initializedFedXFactoryFilegetDataDir()Get the directory where data and logging for this repository is stored.voidinit()Initializes this repository.booleanisInitialized()Indicates if the Repository has been initialized.voidsetDataDir(File dataDir)Set the directory where data and logging for this repository is stored.voidsetFederatedServiceResolver(FederatedServiceResolver resolver)Sets theFederatedServiceResolverto use for this client.voidsetRepositoryResolver(RepositoryResolver resolver)voidshutDown()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:RepositorySet the directory where data and logging for this repository is stored.- Specified by:
setDataDirin interfaceRepository- Overrides:
setDataDirin classRepositoryWrapper- 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.- Specified by:
getDataDirin interfaceRepository- Overrides:
getDataDirin classRepositoryWrapper- Returns:
- the directory where data for this repository is stored.
-
isInitialized
public boolean isInitialized()
Description copied from interface:RepositoryIndicates if the Repository has been initialized. Note that the initialization status may change if the Repository is shut down.- Specified by:
isInitializedin interfaceRepository- Overrides:
isInitializedin classRepositoryWrapper- Returns:
- true iff the repository has been initialized.
-
init
public void init() throws RepositoryExceptionDescription copied from interface:RepositoryInitializes 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:
initin interfaceRepository- Overrides:
initin classRepositoryWrapper- Throws:
RepositoryException- If the initialization failed.
-
createFactory
protected FedXFactory createFactory()
Create the initializedFedXFactory- Returns:
-
shutDown
public void shutDown() throws RepositoryExceptionDescription copied from interface:RepositoryShuts 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:
shutDownin interfaceRepository- Overrides:
shutDownin classRepositoryWrapper- Throws:
RepositoryException
-
setRepositoryResolver
public void setRepositoryResolver(RepositoryResolver resolver)
- Specified by:
setRepositoryResolverin interfaceRepositoryResolverClient
-
setFederatedServiceResolver
public void setFederatedServiceResolver(FederatedServiceResolver resolver)
Description copied from interface:FederatedServiceResolverClientSets theFederatedServiceResolverto use for this client.- Specified by:
setFederatedServiceResolverin interfaceFederatedServiceResolverClient- Parameters:
resolver- The resolver to use.
-
-