public abstract class EndpointBase extends Object implements Endpoint
Endpoint.
Provides implementation for the common behavior as well as connection management. Typically a fresh
RepositoryConnection is returned when invoking getConnection(), however, it is configurable that a
managed (singleton) connection can be used.
EndpointManager| Modifier and Type | Class and Description |
|---|---|
static class |
EndpointBase.ManagedRepositoryConnection
A wrapper for managed
RepositoryConnections which makes sure that EndpointBase.ManagedRepositoryConnection.close() is a no-op, i.e. |
| Modifier and Type | Field and Description |
|---|---|
protected String |
endpoint |
protected EndpointClassification |
endpointClassification |
protected EndpointConfiguration |
endpointConfiguration |
protected boolean |
initialized |
protected static org.slf4j.Logger |
log |
protected RepositoryInformation |
repoInfo |
protected TripleSource |
tripleSource |
protected boolean |
writable |
| Constructor and Description |
|---|
EndpointBase(RepositoryInformation repoInfo,
String endpoint,
EndpointClassification endpointClassification) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetRepositoryprotected static final org.slf4j.Logger log
protected final RepositoryInformation repoInfo
protected final String endpoint
protected EndpointClassification endpointClassification
protected boolean writable
protected boolean initialized
protected TripleSource tripleSource
protected EndpointConfiguration endpointConfiguration
public EndpointBase(RepositoryInformation repoInfo, String endpoint, EndpointClassification endpointClassification)
public String getName()
public TripleSource getTripleSource()
getTripleSource in interface EndpointTripleSourcepublic EndpointClassification getEndpointClassification()
getEndpointClassification in interface EndpointEndpointClassificationpublic void setEndpointClassification(EndpointClassification endpointClassification)
public boolean isLocal()
public boolean isWritable()
isWritable in interface Endpointpublic RepositoryInformation getRepoInfo()
public void setWritable(boolean writable)
writable - the writable to setpublic EndpointConfiguration getEndpointConfiguration()
EndpointgetEndpointConfiguration in interface Endpointpublic void setEndpointConfiguration(EndpointConfiguration endpointConfiguration)
endpointConfiguration - the endpointConfiguration to setpublic RepositoryConnection getConnection()
EndpointRepositoryConnection for the Repository represented 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 RepositoryConnection needs to stay open outside the scope of a method (e.g. for streaming
results), consider using CloseDependentConnectionIteration.
getConnection in interface Endpointprotected RepositoryConnection getFreshConnection()
public String getId()
public String getEndpoint()
EndpointgetEndpoint in interface Endpointpublic EndpointType getType()
public boolean isInitialized()
isInitialized in interface Endpointpublic long size()
throws RepositoryException
Endpointsize in interface EndpointRepositoryExceptionpublic void init(FederationContext federationContext) throws RepositoryException
EndpointEndpointinit in interface EndpointRepositoryExceptionprotected boolean useSingleConnection()
RepositoryConnection throughout the lifetime of this Endpoint.
Note that the RepositoryConnection is wrapped as EndpointBase.ManagedRepositoryConnection
public void shutDown()
throws RepositoryException
EndpointEndpointshutDown in interface EndpointRepositoryExceptionCopyright © 2015-2022 Eclipse Foundation. All Rights Reserved.