org.openrdf.sesame.repository.remote
Class HTTPService

java.lang.Object
  extended byorg.openrdf.sesame.repository.remote.HTTPService
All Implemented Interfaces:
SesameService

public class HTTPService
extends Object
implements SesameService

A Sesame service for remote repositories that can be communicated with over HTTP.

Author:
Jeen Broekstra, Arjohn Kampman

Constructor Summary
HTTPService(URL serverURL)
          Creates a new remote Sesame service that will communicate over HTTP with the server at the specified URL.
 
Method Summary
 SesameRepository getRepository(String repositoryID)
          Gets a SesameRepository object for the specified repository ID.
 RepositoryList getRepositoryList()
          Gets a list of all repositories that are accessible by the currently logged in user.
 void login(String username, String password)
          Log in to a Sesame service.
 void logout()
          Log out from a Sesame service.
 void setDefaultGraphQueryResultFormat(RDFFormat format)
          Sets the default response format for graph query results to be used by HTTPRepository objects of this service.
 void setDefaultTableQueryResultFormat(QueryResultFormat format)
          Sets the default response format for table query results to be used by HTTPRepository objects of this service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPService

public HTTPService(URL serverURL)
Creates a new remote Sesame service that will communicate over HTTP with the server at the specified URL.

Parameters:
serverURL - The Sesame server's URL.
Throws:
IllegalArgumentException - If the supplied URL is null, if it does not specify http as the protocol, or if the combination of the specified server URL and the paths to its servlets results in an illegal URL.
Method Detail

setDefaultTableQueryResultFormat

public void setDefaultTableQueryResultFormat(QueryResultFormat format)
Sets the default response format for table query results to be used by HTTPRepository objects of this service.

Parameters:
format - A table query result format. Allowed values are XML and BINARY.
See Also:
HTTPRepository.setTableQueryResultFormat(org.openrdf.sesame.constants.QueryResultFormat)

setDefaultGraphQueryResultFormat

public void setDefaultGraphQueryResultFormat(RDFFormat format)
Sets the default response format for graph query results to be used by HTTPRepository objects of this service.

Parameters:
format - An RDF serialization format. Allowed values are RDFXML, NTRIPLES and TURTLE.
See Also:
HTTPRepository.setGraphQueryResultFormat(org.openrdf.sesame.constants.RDFFormat)

login

public void login(String username,
                  String password)
           throws AccessDeniedException,
                  IOException
Description copied from interface: SesameService
Log in to a Sesame service.

Specified by:
login in interface SesameService
Throws:
IOException - If an I/O error occurred.
AccessDeniedException - If the attempt to log in failed.

logout

public void logout()
            throws IOException
Description copied from interface: SesameService
Log out from a Sesame service.

Specified by:
logout in interface SesameService
Throws:
IOException - If an I/O error occurred.

getRepositoryList

public RepositoryList getRepositoryList()
                                 throws IOException
Description copied from interface: SesameService
Gets a list of all repositories that are accessible by the currently logged in user. If no user is logged in, all repositories that are world-accessible are retrieved.

Specified by:
getRepositoryList in interface SesameService
Returns:
A RepositoryListImpl
Throws:
IOException - If an I/O error occurred while fetching information about the available repositories.

getRepository

public SesameRepository getRepository(String repositoryID)
                               throws UnknownRepositoryException,
                                      IOException
Description copied from interface: SesameService
Gets a SesameRepository object for the specified repository ID.

Specified by:
getRepository in interface SesameService
Parameters:
repositoryID - A repository ID.
Throws:
UnknownRepositoryException - If the specified repository ID is unknown.
IOException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.