Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Latest commit

 

History

History
68 lines (42 loc) · 2.01 KB

README.md

File metadata and controls

68 lines (42 loc) · 2.01 KB

cypher-http-examples

Examples on how to connect to the Cypher endpoints from Java with different http libraries

Contributions and Feedback wanted!!!

Infrastructure

There is a CypherClient interface with different implementations for different http libraries.

public interface CypherClient {
    ExecutionResult query(String statement, Map<String,Object> params);
}
```

`ExecutionResult` is an interface with methods: 

````java
public interface ExecutionResult extends Iterable<List<Object>> {
    List<String> getColumns();

    Iterator<List<Object>> iterator();

    Iterator<Map<String,Object>> rowIterator();
}

A Util class takes care of URL handling, JSON conversion and postData and ExecutionResult instantiation.

See: http://jersey.java.net/nonav/documentation/latest/user-guide.html#client

Uses Client, WebResource and ClientResponse to access the Cypher endpoint.

      <dependency>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-client</artifactId>
          <version>1.9</version>
      </dependency>

See: http://igorpolevoy.blogspot.de/2011/01/java-rest-with-ease.html http://javalt.org/

See: http://restlet.org/

See: http://docs.jboss.org/resteasy/docs/3.0.2.Final/userguide/html/RESTEasy_Client_Framework.html

HttpClient

RestAssured

Todo

  • Auth
  • Neo4j 2.0 transactional Cypher endpoint examples (including transactions, rollback, batching and streaming)
  • Streaming JSON back and forth
  • .. more client libraries ..