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 specialSailRepositorywhich 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 FedXRepositoryConnectiongetConnection()Opens a connection to this repository that can be used for querying and updating the contents of the repository.FederationContextgetFederationContext()StringgetFederationSize()return the number of triples in the federation as string.QueryManagergetQueryManager()protected voidinitializeInternal()voidsetFederatedServiceResolver(FederatedServiceResolver resolver)Sets theFederatedServiceResolverto use for this client.protected voidshutDownInternal()-
Methods inherited from class org.eclipse.rdf4j.repository.sail.SailRepository
getDataDir, 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:RepositoryOpens 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 thatRepositoryConnectionis 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 ownRepositoryConnections.- Specified by:
getConnectionin interfaceRepository- Overrides:
getConnectionin 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:
initializeInternalin classSailRepository- Throws:
RepositoryException
-
shutDownInternal
protected void shutDownInternal() throws RepositoryException- Overrides:
shutDownInternalin classSailRepository- Throws:
RepositoryException
-
setFederatedServiceResolver
public void setFederatedServiceResolver(FederatedServiceResolver resolver)
Description copied from interface:FederatedServiceResolverClientSets theFederatedServiceResolverto use for this client.- Specified by:
setFederatedServiceResolverin interfaceFederatedServiceResolverClient- Overrides:
setFederatedServiceResolverin 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.NativeStoreandEndpointType.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
QueryManagerfrom theFederationContext
-
-