Skip to content

rickardoberg/cypher-http-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 ..

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%