public class HTTPRepository extends AbstractRepository implements HttpClientDependent, SessionManagerDependent
 This repository proxy uses a Sesame-specific extension of the SPARQL 1.1
 Protocol to communicate with the server. For communicating with a non-Sesame-based SPARQL endpoint, it is
 recommend to use SPARQLRepository instead.
UnauthorizedExceptionlogger| Constructor and Description | 
|---|
| HTTPRepository(String repositoryURL) | 
| HTTPRepository(String serverURL,
              String repositoryID) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected RDF4JProtocolSession | createHTTPClient()Creates a new HTTPClient object. | 
| Map<String,String> | getAdditionalHttpHeaders()Get the additional HTTP headers which will be used | 
| RepositoryConnection | getConnection()Opens a connection to this repository that can be used for querying and updating the contents of the repository. | 
| File | getDataDir()Get the directory where data and logging for this repository is stored. | 
| org.apache.http.client.HttpClient | getHttpClient()HttpClientthat has been assigned or has been used by this object. | 
| HttpClientSessionManager | getHttpClientSessionManager()HttpClientSessionManagerthat has been assigned or has been used by this object. | 
| RDFFormat | getPreferredRDFFormat()Indicates the current preferred  RDFFormat. | 
| TupleQueryResultFormat | getPreferredTupleQueryResultFormat()Indicates the current preferred  TupleQueryResultFormat. | 
| String | getRepositoryURL() | 
| ValueFactory | getValueFactory()Gets a ValueFactory for this Repository. | 
| protected void | initializeInternal() | 
| boolean | isWritable()Checks whether this repository is writable, i.e. | 
| void | setAdditionalHttpHeaders(Map<String,String> additionalHttpHeaders)Set additional HTTP headers to be included in every request to the server, which may be required for certain
 unusual server configurations. | 
| void | setDataDir(File dataDir)Set the directory where data and logging for this repository is stored. | 
| void | setHttpClient(org.apache.http.client.HttpClient httpClient)Assign an  HttpClientthat this object should use. | 
| void | setHttpClientSessionManager(HttpClientSessionManager client)Assign an  HttpClientSessionManagerthat this object should use. | 
| void | setPreferredRDFFormat(RDFFormat format)Sets the preferred serialization format for RDF to the supplied  RDFFormat, overriding theSPARQLProtocolSession's default preference. | 
| void | setPreferredTupleQueryResultFormat(TupleQueryResultFormat format)Sets the preferred serialization format for tuple query results to the supplied  TupleQueryResultFormat,
 overriding theSPARQLProtocolSession's default preference. | 
| void | setUsernameAndPassword(String username,
                      String password)Set the username and password to use for authenticating with the remote repository. | 
| protected void | shutDownInternal() | 
init, initialize, isInitialized, shutDownclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSesameClient, setSesameClientpublic HTTPRepository(String repositoryURL)
public void setDataDir(File dataDir)
RepositorysetDataDir in interface RepositorydataDir - the directory where data for this repository is storedpublic File getDataDir()
RepositorygetDataDir in interface Repositorypublic HttpClientSessionManager getHttpClientSessionManager()
SessionManagerDependentHttpClientSessionManager that has been assigned or has been used by this object. The life cycle might not
 be or might be tied to this object, depending on whether HttpClientSessionManager was passed to or
 created by this object respectively.getHttpClientSessionManager in interface SesameClientDependentgetHttpClientSessionManager in interface SessionManagerDependentHttpClientSessionManager instance or nullpublic void setHttpClientSessionManager(HttpClientSessionManager client)
SessionManagerDependentHttpClientSessionManager that this object should use. The life cycle of the given
 HttpClientSessionManager is independent of this object. Closing or shutting down this object does not
 have any impact on the given client. Callers must ensure that the given client is properly closed elsewhere.setHttpClientSessionManager in interface SesameClientDependentsetHttpClientSessionManager in interface SessionManagerDependentpublic Map<String,String> getAdditionalHttpHeaders()
public void setAdditionalHttpHeaders(Map<String,String> additionalHttpHeaders)
getConnection().additionalHttpHeaders - a map containing pairs of header names and values. May be nullpublic final org.apache.http.client.HttpClient getHttpClient()
HttpClientDependentHttpClient that has been assigned or has been used by this object. The life cycle might not be or might
 be tied to this object, depending on whether HttpClient was passed to or created by this object
 respectively.getHttpClient in interface HttpClientDependentHttpClient instance or nullpublic void setHttpClient(org.apache.http.client.HttpClient httpClient)
HttpClientDependentHttpClient that this object should use. The life cycle of the given HttpClient is
 independent of this object. Closing or shutting down this object does not have any impact on the given client.
 Callers must ensure that the given client is properly closed elsewhere.setHttpClient in interface HttpClientDependentpublic ValueFactory getValueFactory()
RepositorygetValueFactory in interface Repositorypublic RepositoryConnection getConnection() throws RepositoryException
Repository
 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 own RepositoryConnections.getConnection in interface RepositoryRepositoryException - If something went wrong during the creation of the Connection.public boolean isWritable()
                   throws RepositoryException
RepositoryisWritable in interface RepositoryRepositoryExceptionpublic void setPreferredTupleQueryResultFormat(TupleQueryResultFormat format)
TupleQueryResultFormat,
 overriding the SPARQLProtocolSession 's default preference. Setting this parameter is not necessary in
 most cases as the SPARQLProtocolSession by default indicates a preference for the most compact and
 efficient format available.format - the preferred TupleQueryResultFormat. If set to 'null' no explicit preference will be
               stated.public TupleQueryResultFormat getPreferredTupleQueryResultFormat()
TupleQueryResultFormat.public void setPreferredRDFFormat(RDFFormat format)
RDFFormat, overriding the
 SPARQLProtocolSession's default preference. Setting this parameter is not necessary in most cases as the
 SPARQLProtocolSession by default indicates a preference for the most compact and efficient format
 available.
 Use with caution: if set to a format that does not support context serialization any context info contained in the query result will be lost.
format - the preferred RDFFormat. If set to 'null' no explicit preference will be stated.public RDFFormat getPreferredRDFFormat()
RDFFormat.public void setUsernameAndPassword(String username, String password)
username - the username. Setting this to null will disable authentication.password - the password. Setting this to null will disable authentication.public String getRepositoryURL()
protected void initializeInternal()
                           throws RepositoryException
initializeInternal in class AbstractRepositoryRepositoryExceptionprotected void shutDownInternal()
                         throws RepositoryException
shutDownInternal in class AbstractRepositoryRepositoryExceptionprotected RDF4JProtocolSession createHTTPClient()
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.