Package org.openrdf.http.server.helpers

Examples of org.openrdf.http.server.helpers.ServerConnection


    throws ResourceException
  {
    setDimensions(ServerUtil.VARY_ACCEPT);

    if (variant.getMediaType().equals(MediaType.TEXT_PLAIN, true)) {
      ServerConnection connection = getConnection();
      ValueFactory vf = connection.getValueFactory();

      StatementPatternParams spParams = new StatementPatternParams(getRequest(), vf);

      Resource subj = spParams.getSubject();
      URI pred = spParams.getPredicate();
      Value obj = spParams.getObject();
      Resource[] contexts = spParams.getContext();
      boolean includeInferred = spParams.isIncludeInferred();

      try {
        long size = connection.sizeMatch(subj, pred, obj, includeInferred, contexts);
        return new StringRepresentation(String.valueOf(size));
      }
      catch (StoreException e) {
        throw new ResourceException(e);
      }
View Full Code Here


  @Override
  protected Representation delete(Variant variant)
    throws ResourceException
  {
    try {
      ServerConnection connection = getConnection();
      connection.clearNamespaces();
      connection.getCacheInfo().processUpdate();

      getResponse().setStatus(SUCCESS_NO_CONTENT);
      return null;
    }
    catch (StoreException e) {
View Full Code Here

  @Override
  protected Representation delete()
    throws ResourceException
  {
    ServerConnection connection = getConnection();

    if (connection != null) {
      try {
        connection.close();
        return null;
      }
      catch (StoreException e) {
        throw new ResourceException(e);
      }
View Full Code Here

          throw new ResourceException(CLIENT_ERROR_BAD_REQUEST,
              "No namespace name found in request body");
        }
        // FIXME: perform some sanity checks on the namespace string

        ServerConnection connection = getConnection();
        connection.setNamespace(prefix, namespace);
        connection.getCacheInfo().processUpdate();

        getResponse().setStatus(SUCCESS_NO_CONTENT);
        return null;
      }
      catch (IOException e) {
View Full Code Here

  @Override
  protected Representation delete(Variant variant)
    throws ResourceException
  {
    try {
      ServerConnection connection = getConnection();
      connection.removeNamespace(prefix);
      connection.getCacheInfo().processUpdate();

      getResponse().setStatus(SUCCESS_NO_CONTENT);
      return null;
    }
    catch (StoreException e) {
View Full Code Here

TOP

Related Classes of org.openrdf.http.server.helpers.ServerConnection

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.