Package org.openrdf.repository.http

Examples of org.openrdf.repository.http.HTTPRepository


  }

  public Repository getRepository(RepositoryImplConfig config)
    throws StoreConfigException
  {
    HTTPRepository result = null;

    if (config instanceof HTTPRepositoryConfig) {
      HTTPRepositoryConfig httpConfig = (HTTPRepositoryConfig)config;
      result = new HTTPRepository(httpConfig.getURL());
      result.setSubjectSpace(httpConfig.getSubjectSpace());
      result.setReadOnly(httpConfig.isReadOnly());
      // result.setUsernameAndPassword(httpConfig.getUsername(),
      // httpConfig.getPassword());
    }
    else {
      throw new StoreConfigException("Invalid configuration class: " + config.getClass());
View Full Code Here


   */
  @Override
  protected Repository createRepository(String id)
    throws StoreConfigException, StoreException
  {
    HTTPRepository result = null;

    if (hasRepositoryConfig(id)) {
      result = new HTTPRepository(serverURL, id);
      result.setUsernameAndPassword(username, password);
      result.initialize();
    }

    return result;
  }
View Full Code Here

   
    return repository;
  }
 
  public QueryResultTable sparqlSelect(String endpointURL, String sparqlQuery) {
    HTTPRepository endpoint = new HTTPRepository(endpointURL, "");
    try {
      endpoint.initialize();
      RepositoryConnection connection = endpoint.getConnection();
     
      return new RepositoryQueryResultTable(sparqlQuery, connection);
    } catch(RepositoryException e) {
      throw new ModelRuntimeException(e);
    }
View Full Code Here

        System.out.println("HTTP Connection");
        String dataServer = (String) props.get("server.url");
        String dataRepositoryID = (String) props.get("data.repository.id");
        System.out.println("Server: "+dataServer);
        System.out.println("Repository: "+dataRepositoryID);
        localRepository = new HTTPRepository(dataServer, dataRepositoryID);
        localRepository.shutDown();
        localRepository.initialize();
      } else {
        System.out.println("Memory Connection");
        if (!dataDir.exists()) {
View Full Code Here

  @Override
  protected Repository createSystemRepository()
    throws RepositoryException
  {
    HTTPRepository systemRepository = new HTTPRepository(serverURL, SystemRepository.ID);
    systemRepository.initialize();
    return systemRepository;
  }
View Full Code Here

    return serverURL;
  }

  @Override
  public HTTPRepository getSystemRepository() {
    HTTPRepository result = (HTTPRepository)super.getSystemRepository();
    result.setUsernameAndPassword(username, password);
    return result;
  }
View Full Code Here

    throws RepositoryConfigException, RepositoryException
  {
    Repository result = null;

    if (RepositoryConfigUtil.hasRepositoryConfig(getSystemRepository(), id)) {
      result = new HTTPRepository(serverURL, id);
      result.initialize();
    }

    return result;
  }
View Full Code Here

  {
    boolean result = true;

    HttpSession session = request.getSession(true);
    RepositoryInfo repoInfo = (RepositoryInfo)session.getAttribute(SessionKeys.REPOSITORY_INFO_KEY);
    HTTPRepository repo = (HTTPRepository)session.getAttribute(SessionKeys.REPOSITORY_KEY);

    if (request.getRequestURI().endsWith("/repository/overview.view")) {
      String id = request.getParameter("id");
      if (id != null) {
        Server server = (Server)session.getAttribute(SessionKeys.SERVER_KEY);
        repo = (HTTPRepository)server.getRepositoryManager().getRepository(id);
        try {
          repo.initialize();
          repoInfo = server.getRepositoryManager().getRepositoryInfo(id);
        }
        catch (RepositoryException e) {
          session.setAttribute(SessionKeys.REPOSITORY_EXCEPTION_KEY, e);
        }
View Full Code Here

public class RepositoryController implements Controller {

  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
    HttpSession session = request.getSession(false);
   
    HTTPRepository repo = (HTTPRepository)session.getAttribute(SessionKeys.REPOSITORY_KEY);
    RepositoryInfo repoInfo = (RepositoryInfo)session.getAttribute(SessionKeys.REPOSITORY_INFO_KEY);
   
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("repository", repo);
    model.put("repositoryInfo", repoInfo);
View Full Code Here

      BindException errors)
    throws Exception
  {
    ModelAndView result = null;

    HTTPRepository repo = (HTTPRepository)request.getSession().getAttribute(SessionKeys.REPOSITORY_KEY);

    ConstructQueryInfo qInfo = (ConstructQueryInfo)command;

    String resultString = "";

    RepositoryConnection conn = null;
    try {
      conn = repo.getConnection();

      HTTPGraphQuery query = (HTTPGraphQuery)conn.prepareGraphQuery(qInfo.getQueryLanguage(),
          qInfo.getQueryString());
      query.setIncludeInferred(qInfo.isIncludeInferred());
      GraphQueryResult queryResult = null;
View Full Code Here

TOP

Related Classes of org.openrdf.repository.http.HTTPRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.