Class FedXRepository
- java.lang.Object
-
- org.eclipse.rdf4j.repository.base.AbstractRepository
-
- org.eclipse.rdf4j.repository.sail.SailRepository
-
- org.eclipse.rdf4j.federated.repository.FedXRepository
-
- All Implemented Interfaces:
HttpClientDependent
,SessionManagerDependent
,FederatedServiceResolverClient
,Repository
,RepositoryResolverClient
public class FedXRepository extends SailRepository
A specialSailRepository
which performs the actions as defined inFedXRepositoryConnection
.- Author:
- as
-
-
Field Summary
-
Fields inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository
logger
-
-
Constructor Summary
Constructors Constructor Description FedXRepository(FedX federation, FedXConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FedXRepositoryConnection
getConnection()
Opens a connection to this repository that can be used for querying and updating the contents of the repository.FederationContext
getFederationContext()
String
getFederationSize()
return the number of triples in the federation as string.QueryManager
getQueryManager()
protected void
initializeInternal()
void
setFederatedServiceResolver(FederatedServiceResolver resolver)
Sets theFederatedServiceResolver
to use for this client.protected void
shutDownInternal()
-
Methods inherited from class org.eclipse.rdf4j.repository.sail.SailRepository
getDataDir, getFederatedServiceResolver, getHttpClient, getHttpClientSessionManager, getSail, getValueFactory, isWritable, setDataDir, setHttpClient, setHttpClientSessionManager, setRepositoryResolver, toString
-
Methods inherited from class org.eclipse.rdf4j.repository.base.AbstractRepository
init, isInitialized, shutDown
-
-
-
-
Constructor Detail
-
FedXRepository
public FedXRepository(FedX federation, FedXConfig config)
-
-
Method Detail
-
getConnection
public FedXRepositoryConnection getConnection() throws RepositoryException
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-with-resources block, as follows: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 ownRepositoryConnection
s.- Specified by:
getConnection
in interfaceRepository
- Overrides:
getConnection
in classSailRepository
- Returns:
- A connection that allows operations on this repository.
- Throws:
RepositoryException
- If something went wrong during the creation of the Connection.
-
initializeInternal
protected void initializeInternal() throws RepositoryException
- Overrides:
initializeInternal
in classSailRepository
- Throws:
RepositoryException
-
shutDownInternal
protected void shutDownInternal() throws RepositoryException
- Overrides:
shutDownInternal
in classSailRepository
- Throws:
RepositoryException
-
setFederatedServiceResolver
public void setFederatedServiceResolver(FederatedServiceResolver resolver)
Description copied from interface:FederatedServiceResolverClient
Sets theFederatedServiceResolver
to use for this client.- Specified by:
setFederatedServiceResolver
in interfaceFederatedServiceResolverClient
- Overrides:
setFederatedServiceResolver
in classSailRepository
- Parameters:
resolver
- The resolver to use.
-
getFederationSize
public String getFederationSize()
return the number of triples in the federation as string. Retrieving the size is only supportedEndpointType.NativeStore
andEndpointType.RemoteRepository
. If the federation contains other types of endpoints, the size is indicated as a lower bound, i.e. the string starts with a larger sign.- Returns:
- the number of triples in the federation
-
getFederationContext
public FederationContext getFederationContext()
- Returns:
- the
FederationContext
-
getQueryManager
public QueryManager getQueryManager()
- Returns:
- the
QueryManager
from theFederationContext
-
-