Package org.openrdf.http.client.connections

Examples of org.openrdf.http.client.connections.HTTPRequest


  }

  public BNode post(String nodeID)
    throws StoreException, QueryResultParseException, NoCompatibleMediaType
  {
    HTTPRequest request = pool.post();

    NameValuePair pair = new NameValuePair(NODE_ID, nodeID);
    request.sendQueryString(Arrays.asList(pair));

    try {
      request.acceptTupleQueryResult();
      execute(request);
      TupleResult result = request.getTupleQueryResult();
      try {
        if (result.hasNext()) {
          BindingSet bindings = result.next();
          return (BNode)bindings.getValue(BNODE);
        }
View Full Code Here


  }

  public TupleResult list()
    throws StoreException
  {
    HTTPRequest request = pool.get();

    try {
      request.acceptTupleQueryResult();
      execute(request);
      if (request.isNotModified()) {
        return null;
      }
      return request.getTupleQueryResult();
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    catch (NoCompatibleMediaType e) {
View Full Code Here

  }

  public String create()
    throws StoreException
  {
    HTTPRequest request = pool.post();
    try {
      execute(request);
      if (request.isNotModified()) {
        return null;
      }
      return request.readLocation();
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public <T> T get(Class<T> type)
    throws StoreException
  {
    HTTPRequest request = pool.get();

    try {
      request.accept(type);
      execute(request);
      if (request.isNotModified()) {
        return null;
      }
      return request.read(type);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    catch (NoCompatibleMediaType e) {
      throw new StoreException(e);
    }
    catch (NumberFormatException e) {
      throw new StoreException(e);
    }
    catch (QueryResultParseException e) {
      throw new StoreException(e);
    }
    catch (RDFParseException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public void post()
    throws StoreException
  {
    HTTPRequest request = pool.post();
    try {
      execute(request);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public void put(Object instance)
    throws StoreException
  {
    HTTPRequest request = pool.put();
    try {
      request.send(instance);
      execute(request);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public void post(Object instance)
    throws StoreException
  {
    HTTPRequest request = pool.post();
    try {
      request.send(instance);
      execute(request);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public void delete()
    throws StoreException
  {
    HTTPRequest request = pool.delete();
    try {
      execute(request);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public <T> T get(String id, Class<T> type)
    throws StoreException
  {
    HTTPRequest request = pool.slash(id).get();

    try {
      request.accept(type);
      try {
        request.execute();
        if (request.isNotModified()) {
          return null;
        }
      }
      catch (NotFound e) {
        return null;
      }
      catch (UnsupportedQueryLanguage e) {
        throw new UnsupportedQueryLanguageException(e);
      }
      catch (UnsupportedFileFormat e) {
        throw new UnsupportedRDFormatException(e);
      }
      catch (UnsupportedMediaType e) {
        throw new UnsupportedRDFormatException(e);
      }
      catch (Unauthorized e) {
        throw new UnauthorizedException(e);
      }
      catch (HTTPException e) {
        throw new StoreException(e);
      }
      return request.read(type);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    catch (NumberFormatException e) {
      throw new StoreException(e);
    }
    catch (QueryResultParseException e) {
      throw new StoreException(e);
    }
    catch (RDFParseException e) {
      throw new StoreException(e);
    }
    catch (NoCompatibleMediaType e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

  }

  public void put(String id, Object instance)
    throws StoreException
  {
    HTTPRequest request = pool.slash(id).put();
    try {
      request.send(instance);
      execute(request);
    }
    catch (IOException e) {
      throw new StoreException(e);
    }
    finally {
      request.release();
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.http.client.connections.HTTPRequest

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.