Examples of RestApi


Examples of org.drools.repository.remoteapi.RestAPI

    protected void doPut(final HttpServletRequest req, final HttpServletResponse res)
        throws ServletException, IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          res.setContentType( "text/html" );
          RestAPI api = getAPI();
          String comment = req.getHeader("Checkin-Comment");
          Calendar lastMod = getModified(req.getHeader("Last-Modified"));
          api.put(req.getRequestURI(), lastMod, req.getInputStream()(comment != null)? comment : "");
          res.getWriter().write( "OK" );
      }
        });
    }
View Full Code Here

Examples of org.drools.repository.remoteapi.RestAPI

    protected void doDelete(final HttpServletRequest req, final HttpServletResponse res)
        throws ServletException, IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          res.setContentType( "text/html" );
          RestAPI api = getAPI();
          api.delete(req.getRequestURI());
          res.getWriter().write( "OK" );
      }
        });
    }
View Full Code Here

Examples of org.drools.repository.remoteapi.RestAPI

    }

  }

  RestAPI getAPI()  {
    return new RestAPI(getRepository());
  }
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

                    throw new RuntimeException("Invalid Neo4j-Server-URL " + restUrl);
                }
            }

            if (!restUrl.contains("/db/data")) restUrl += "/db/data";
            final RestAPI api = new RestAPIFacade(restUrl, login, password);
            storage = new RestGraphStorage(api);
            log("Graph Storage " + restUrl + " login " + login + " " + password + " " + storage);
        }
        } catch(Exception e) {
            LOG.error("Error creating graph storage",e);
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

    }

    public void initFromUrl(Neo4jService service, URL url, final String query) {
        if (!service.doesOwnDatabase()) return;
        final String urlString = url.toString().replaceAll("/cypher/?$", "");
        final RestAPI restApi = new RestAPIFacade(urlString);
        final QueryResult<Map<String,Object>> cypherResult = new RestCypherQueryEngine(restApi).query(query, null);
        final SubGraph graph = new SubGraph();
        for (Map<String, Object> row : cypherResult) {
            for (Object value : row.values()) {
                addResultValue(graph, value);
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

        throw new CdoException("Transactions are not supported for this datastore.");
    }

    @Override
    public <QL> ResultIterator<Map<String, Object>> execute(QL expression, Map<String, Object> parameters) {
        RestAPI restAPI = getGraphDatabaseService().getRestAPI();
        RestCypherQueryEngine restCypherQueryEngine = new RestCypherQueryEngine(restAPI);
        QueryResult<Map<String, Object>> queryResult = restCypherQueryEngine.query(getCypher(expression), parameters);
        final Iterator<Map<String, Object>> iterator = queryResult.iterator();
        return new ResultIterator() {
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

        return transaction;
    }

    @Override
    public <QL> ResultIterator<Map<String, Object>> executeQuery(QL expression, Map<String, Object> parameters) {
        RestAPI restAPI = getGraphDatabaseService().getRestAPI();
        RestCypherQueryEngine restCypherQueryEngine = new RestCypherQueryEngine(restAPI);
        QueryResult<Map<String, Object>> queryResult = restCypherQueryEngine.query(getCypher(expression), parameters);
        final Iterator<Map<String, Object>> iterator = queryResult.iterator();
        return new ResultIterator<Map<String, Object>>() {
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

        }

        @Override
        public ResultIterator<Map<String, Object>> execute(String expression, Map<String, Object> parameters) {
            Map<String, Object> effectiveParameters = translateParameters(parameters);
            RestAPI restAPI = getGraphDatabaseService().getRestAPI();
            RestCypherQueryEngine restCypherQueryEngine = new RestCypherQueryEngine(restAPI);
            QueryResult<Map<String, Object>> queryResult = restCypherQueryEngine.query(expression, effectiveParameters);

            final Iterator<Map<String, Object>> iterator = queryResult.iterator();
            return new ResultIterator<Map<String, Object>>() {
View Full Code Here

Examples of org.neo4j.rest.graphdb.RestAPI

    }

    @Override
    public <QL> ResultIterator<Map<String, Object>> executeQuery(QL expression, Map<String, Object> parameters) {
        Map<String, Object> effectiveParameters = translateParameters(parameters);
        RestAPI restAPI = getGraphDatabaseService().getRestAPI();
        RestCypherQueryEngine restCypherQueryEngine = new RestCypherQueryEngine(restAPI);
        QueryResult<Map<String, Object>> queryResult = restCypherQueryEngine.query(getCypher(expression), effectiveParameters);

        final Iterator<Map<String, Object>> iterator = queryResult.iterator();
        return new ResultIterator<Map<String, Object>>() {
View Full Code Here

Examples of org.ngrinder.common.controller.RestAPI

                                       Exception ex) {
    if (!(handler instanceof HandlerMethod)) {
      return null;
    }

    RestAPI methodAnnotation = ((HandlerMethod) handler).getMethodAnnotation(RestAPI.class);
    if (methodAnnotation == null) {
      return null;
    }
    JsonObject object = new JsonObject();
    object.addProperty(JSON_SUCCESS, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.