Interface Endpoint
-
- All Known Implementing Classes:
EndpointBase,ManagedRepositoryEndpoint,RepositoryEndpoint,ResolvableEndpoint
public interface EndpointStructure to maintain endpoint information, e.g.Repositorytype, location.The
Repositoryto use can be obtained by callinggetRepository()A
RepositoryConnectionfor interacting with the store can be obtained usinggetConnection(). Note that typically theTripleSourceof the endpoint should be used.- Author:
- Andreas Schwarte
- See Also:
ManagedRepositoryEndpoint,RepositoryEndpoint,ResolvableEndpoint
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RepositoryConnectiongetConnection()Return aRepositoryConnectionfor theRepositoryrepresented by this endpoint.StringgetEndpoint()Get the endpoint location, e.g.EndpointClassificationgetEndpointClassification()EndpointConfigurationgetEndpointConfiguration()Additional endpoint specific configuration.StringgetId()StringgetName()RepositorygetRepository()TripleSourcegetTripleSource()voidinit(FederationContext federationContext)Initialize thisEndpointbooleanisInitialized()booleanisWritable()voidshutDown()Shutdown thisEndpointlongsize()Returns the size of the given repository, i.e.
-
-
-
Method Detail
-
getRepository
Repository getRepository()
- Returns:
- the initialized
Repository
-
getConnection
RepositoryConnection getConnection()
Return aRepositoryConnectionfor theRepositoryrepresented by this endpoint.Callers of this method need to ensure to close the connection after use.
Typical pattern:
try (RepositoryConnection conn = endpoint.getConnection()) { // do something with the connection }If the
RepositoryConnectionneeds to stay open outside the scope of a method (e.g. for streaming results), consider usingCloseDependentConnectionIteration.- Returns:
- the repository connection
- Throws:
RepositoryException- if the repository is not initialized
-
getTripleSource
TripleSource getTripleSource()
- Returns:
- the
TripleSource
-
getEndpointClassification
EndpointClassification getEndpointClassification()
- Returns:
- the
EndpointClassification
-
isWritable
boolean isWritable()
- Returns:
- whether this endpoint is writable
-
getId
String getId()
- Returns:
- the identifier of the federation member
-
getName
String getName()
- Returns:
- the name of the federation member
-
getEndpoint
String getEndpoint()
Get the endpoint location, e.g. for SPARQL endpoints the url- Returns:
- the endpoint location
-
size
long size() throws RepositoryException
Returns the size of the given repository, i.e. the number of triples.- Returns:
- the size of the endpoint
- Throws:
RepositoryException
-
init
void init(FederationContext federationContext) throws RepositoryException
Initialize thisEndpoint- Parameters:
federationContext-- Throws:
RepositoryException
-
shutDown
void shutDown() throws RepositoryExceptionShutdown thisEndpoint- Throws:
RepositoryException
-
isInitialized
boolean isInitialized()
- Returns:
- whether this Endpoint is initialized
-
getEndpointConfiguration
EndpointConfiguration getEndpointConfiguration()
Additional endpoint specific configuration.- Returns:
- the endpointConfiguration
-
-