|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.repository.http.HTTPRepository
public class HTTPRepository
A repository that serves as a proxy for a remote repository on a Sesame server. Methods in this class may throw the specific RepositoryException subclass UnautorizedException, the semantics of which is defined by the HTTP protocol.
UnauthorizedException| Constructor Summary | |
|---|---|
HTTPRepository(String repositoryURL)
|
|
HTTPRepository(String serverURL,
String repositoryID)
|
|
| Method Summary | |
|---|---|
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. |
RDFFormat |
getPreferredRDFFormat()
Indicates the current preferred RDFFormat. |
TupleQueryResultFormat |
getPreferredTupleQueryResultFormat()
Indicates the current preferred TupleQueryResultFormat. |
ValueFactory |
getValueFactory()
Gets a ValueFactory for this Repository. |
void |
initialize()
Initializes this repository. |
boolean |
isWritable()
Checks whether this repository is writable, i.e. |
void |
setDataDir(File dataDir)
Set the directory where data and logging for this repository is stored. |
void |
setPreferredRDFFormat(RDFFormat format)
Sets the preferred serialization format for RDF to the supplied RDFFormat, overriding the HTTPClient's default preference. |
void |
setPreferredTupleQueryResultFormat(TupleQueryResultFormat format)
Sets the preferred serialization format for tuple query results to the supplied TupleQueryResultFormat, overriding the HTTPClient
's default preference. |
void |
setUsernameAndPassword(String username,
String password)
Set the username and password to use for authenticating with the remote repository. |
void |
shutDown()
Shuts the repository down, releasing any resources that it keeps hold of. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HTTPRepository(String serverURL,
String repositoryID)
public HTTPRepository(String repositoryURL)
| Method Detail |
|---|
public void setDataDir(File dataDir)
Repository
setDataDir in interface RepositorydataDir - the directory where data for this repository is storedpublic File getDataDir()
Repository
getDataDir in interface Repository
public void initialize()
throws RepositoryException
Repository
initialize in interface RepositoryRepositoryException - If the initialization failed.
public void shutDown()
throws RepositoryException
Repository
shutDown in interface RepositoryRepositoryExceptionpublic ValueFactory getValueFactory()
Repository
getValueFactory in interface Repository
public RepositoryConnection getConnection()
throws RepositoryException
Repository
Connection con = repository.getConnection();
try {
// perform operations on the connection
}
finally {
con.close();
}
getConnection in interface RepositoryRepositoryException - If something went wrong during the creation of the Connection.
public boolean isWritable()
throws RepositoryException
Repository
isWritable in interface RepositoryRepositoryExceptionpublic void setPreferredTupleQueryResultFormat(TupleQueryResultFormat format)
TupleQueryResultFormat, overriding the HTTPClient
's default preference. Setting this parameter is not necessary in most
cases as the HTTPClient 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 HTTPClient's default preference.
Setting this parameter is not necessary in most cases as the
HTTPClient 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||